
# -> Reset value
scoreboard players set #or.player_gamemode OverlyRealistic.General.ArbitraryData 0

# -> Get gamemode
execute if entity @s[gamemode=adventure] run \
    scoreboard players set #or.player_gamemode OverlyRealistic.General.ArbitraryData 1
execute if entity @s[gamemode=creative] run \
    scoreboard players set #or.player_gamemode OverlyRealistic.General.ArbitraryData 2
execute if entity @s[gamemode=survival] run \
    scoreboard players set #or.player_gamemode OverlyRealistic.General.ArbitraryData 3

# -> Set gamemode
gamemode creative @s

# -> Move player
tp ~ ~-99999 ~

# -> Apply velocity
execute positioned ~ ~-99996 ~ \
    summon end_crystal run \
        damage @s 0 generic

# -> Move player back
tp ~ ~ ~

# -> Reset gamemode
execute if score #or.player_gamemode OverlyRealistic.General.ArbitraryData matches 1 run \
    return run \
        gamemode adventure @s
execute if score #or.player_gamemode OverlyRealistic.General.ArbitraryData matches 2 run \
    return run \
        gamemode creative @s
gamemode survival @s