Skip to content

Instantly share code, notes, and snippets.

@intsuc
Created October 4, 2019 09:14
Show Gist options
  • Save intsuc/c504e2e73413f8c399d4281c380eb234 to your computer and use it in GitHub Desktop.
Save intsuc/c504e2e73413f8c399d4281c380eb234 to your computer and use it in GitHub Desktop.

Usage

/function place

# place.mcfunction

execute positioned 1000000 0 0 run function load_async
schedule function on_loaded 2
# on_loaded.mcfunction

setblock 1000000 0 0 minecraft:stone
# Passenger must be `LivingEntity`
summon minecraft:armor_stand 8.0 0.0 8.0 {Tags: ["vehicle"], Passengers: [{id: "minecraft:armor_stand", Tags: ["passenger"]}]}
# Move passenger to the current world position
execute as @e[x=7.5, y=-0.5, z=7.5, dx=0.0, tag=passenger] run function move_passenger
# Eject passenger
kill @e[x=7.5, y=-0.5, z=7.5, dx=0.0, tag=vehicle]
kill @s
# Center the current entity within chunk
execute positioned ~-8.0 0.0 ~-8.0 positioned ~72057594067927952.0 0.0 ~72057594067927952.0 positioned ~-72057594067927952.0 0.0 ~-72057594067927952.0 run teleport @s ~8.0 0.0 ~8.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment