1

I've been having trouble making menu GUIs in 1.16. My best idea so far was to create a command making it so when ever there is a nether star in my inventory it teleports a minecart with a chest in it to me. But the problem is it teleports it to my feet, and not my head. Here are the commands I used:

/execute if entity @p[nbt={Inventory:[{id:"minecraft:nether_star",tag:{display:{Name:'{"text":"Menu"}'}}}]}] (to find a nether star in my inventory)

/teleport @e[type=minecraft:chest_minecart,y=3] @p (to teleport the minecart)

2

You must use ~ ~2 ~ instead of @p! If you teleport an entity to another entity the entity you teleport will always get teleported to the feat! But if you only replace @p with ~ ~2~ the minecart will be teleported to the command block! To fix that you must do it like this: /execute as @p at @s run tp @e[type=minecraft:chest_minecart,y=3] ~ ~2 ~

I hope that solve your problem!

Do you know you dont need to type /teleport! /tp will also work :)

| improve this answer | |
  • Thank You so much! I've been trying to find the answer to this for like 3 days! (and btw ik you can use /tp XD I don't even know why I did /teleport) – Ghastyyy Jul 5 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.