#Item in item frames grant
1 messages · Page 1 of 1 (latest)
Name the key something unique
Let's say "k1"
the player approaches the item frame
They tap it, it goes out of the item frame
And then
/scoreboard objectives add k dummy
(Chat command)
Repeating command blocks always active
/execute at @e[type=item,name=k1] run /scoreboard players add @e[type=player,r=6,c=1,scores={k=0}] k 1
/kill @e[type=item,name=k1]
/execute as @e[type=player,scores={k=1}] at @s if entity @e[type=item,name=k1,r=6] run /tellraw @s {"rawtext":[{"text":"You already have "},{"score":{"name":"*","objective":"k"}},{"text":"/4 keys!"}]}
Make it continuously clone the item frame
The /kill just makes it so people can't pick up the item
Repeating command blocks always active
/execute at @e[type=item,name=k2] run /scoreboard players add @e[type=player,r=6,c=1,scores={k=1}] k 1
/kill @e[type=item,name=k2]
/execute as @e[type=player,scores={k=2}] at @s if entity @e[type=item,name=k2,r=6] run /tellraw @s {"rawtext":[{"text":"You already have "},{"score":{"name":"*","objective":"k"}},{"text":"/4 keys!"}]}
This is for the second key
Repeating command blocks always active
/execute at @e[type=item,name=k3] run /scoreboard players add @e[type=player,r=6,c=1,scores={k=2}] k 1
/kill @e[type=item,name=k3]
/execute as @e[type=player,scores={k=3}] at @s if entity @e[type=item,name=k3,r=6] run /tellraw @s {"rawtext":[{"text":"You already have "},{"score":{"name":"*","objective":"k"}},{"text":"/4 keys!"}]}
Repeating command blocks always active
/execute at @e[type=item,name=k4] run /scoreboard players add @e[type=player,r=6,c=1,scores={k=3}] k 1
/kill @e[type=item,name=k4]
/execute as @e[type=player,scores={k=4}] at @s if entity @e[type=item,name=k4,r=6] run /tellraw @s {"rawtext":[{"text":"You already have "},{"score":{"name":"*","objective":"k"}},{"text":"/4 keys!"}]}
Actually let me check if you can use / in tellraw
Yeah should be fine