Hello, I've been trying to get a small key system to work smoothly but I keep running into this problem: I am unable to specify which block has to be clicked in order for the key to work. Currently the key will teleport the player to a location tied to the key regardless of which emerald block it is. It would make things a thousand times easier if I could specify the block. I am sorry if it's a dumb question or anything.
How it works right now:
This is the code that I have been trying things out with, I do have to say that I run on an older version because I am using this on a server with some mods:
How it works right now:
Code:
on rightclick on emerald block:
if player is not holding emerald or nether star or blaze rod or nether quartz:
send "&c&oYou require a Dungeon Key to enter." to player
on rightclick on emerald block:
if player is holding emerald named "Emerald Key":
teleport player to location at -106531, 110, 61700 in world "DIM100"
remove emerald named "Emerald Key" from player's inventory
on rightclick on emerald block:
if player is holding nether star named "Star Key":
teleport player to location at -106531, 110, 61700 in world "DIM100"
remove nether star named "Star Key" from player's inventory
This is the code that I have been trying things out with, I do have to say that I run on an older version because I am using this on a server with some mods:
Code:
on rightclick on emerald block:
if event-block's location is 12698, 88, 5054 in world "DIM100":
send "Succes" to player