I am creating a map in which the players have to find 4 keys (blocks) and when the players have them, they can access a place, only the one that has the 4 blocks in their inventory
I have this command
/ execute if entity @p [x = 5688, y = 48, z = 5759, distance = 0..1] if entity @p [nbt = {Inventory: [{id: "minecraft: red_glazed_terracotta"}]}] if entity @p [nbt = {Inventory: [{id: "minecraft: green_glazed_terracotta"}]}] if entity @p [nbt = {Inventory: [{id: "minecraft: yellow_glazed_terracotta"}]}] if entity @p [ nbt = {Inventory: [{id: "minecraft: light_blue_glazed_terracotta"}]}] run tp @p 5679 46 5769 -15 6
The problem is that the system reads all the inventories of each player as if it were one, as long as a single player has all 4 blocks, everyone can access without having those blocks. I have tried all entities, a, e, p, s (@s never works for me at all)
Hello everyone, I need help with the following.
I am creating a map in which the players have to find 4 keys (blocks) and when the players have them, they can access a place, only the one that has the 4 blocks in their inventory
I have this command
/ execute if entity @p [x = 5688, y = 48, z = 5759, distance = 0..1] if entity @p [nbt = {Inventory: [{id: "minecraft: red_glazed_terracotta"}]}] if entity @p [nbt = {Inventory: [{id: "minecraft: green_glazed_terracotta"}]}] if entity @p [nbt = {Inventory: [{id: "minecraft: yellow_glazed_terracotta"}]}] if entity @p [ nbt = {Inventory: [{id: "minecraft: light_blue_glazed_terracotta"}]}] run tp @p 5679 46 5769 -15 6
The problem is that the system reads all the inventories of each player as if it were one, as long as a single player has all 4 blocks, everyone can access without having those blocks. I have tried all entities, a, e, p, s (@s never works for me at all)
Thanks to all
your command had a lot of unnecessary stuff, so I cleaned it up and fixed it so this should work:
also, you don't need to use an execute command for this, you can just use a tp command like this:
summon minecraft:armor_stand ~ ~0.5 ~ {NoBasePlate:1b,ShowArms:1b,ArmorItems:[{id:leather_boots,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:leather_leggings,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:leather_chestplate,Count:1b,tag:{Unbreakable:1b,display:{color:11546150}}},{id:player_head,Count:1b,tag:{SkullOwner:"Rocker09871",display:{Name:'{"text":"ror","color":"yellow"}'}}}],HandItems:[{id:potion,Count:1b,tag:{Enchantments:[{id:fortune,lvl:32767}],Potion:"water",display:{Name:'[{"text":"Vegan ","color":"green","bold":true,"italic":false},{"text":"Water","color":"blue","bold":true,"italic":false}]'}}},{id:potion,Count:1b,tag:{Enchantments:[{id:fortune,lvl:32767}],Potion:"water",display:{Name:'[{"text":"Vegan ","color":"green","bold":true,"italic":false},{"text":"Water","color":"blue","bold":true,"italic":false}]'}}}],Pose:{RightArm:[-30f,-20f,20f],LeftArm:[-70f,30f],Head:[30f,0f]}}
Thank you! it works perfectly!