Hello, how to do something like that when you click on the diamond, this tellraw chat appears:
[/pre]
/tellraw @a ["",{"text":"[","color":"dark_gray"},{"text":"Podpowiedz","color":"red"},{"text":"] -","color":"dark_gray"},{"text":" Przycisk jest nad domem.","color":"yellow"}]
One way is to summon an invisible villager and constantly teleport it in front of the player. Create an objective with the criteria minecraft.custom:minecraft.talked_to_villager which will increase every time the player right-clicks on the invisible villager. When the score increases, check if the player is holding a diamond and run the command if so.
[/pre]
/tellraw @a ["",{"text":"[","color":"dark_gray"},{"text":"Podpowiedz","color":"red"},{"text":"] -","color":"dark_gray"},{"text":" Przycisk jest nad domem.","color":"yellow"}]
[/pre]
One way is to summon an invisible villager and constantly teleport it in front of the player. Create an objective with the criteria minecraft.custom:minecraft.talked_to_villager which will increase every time the player right-clicks on the invisible villager. When the score increases, check if the player is holding a diamond and run the command if so.
To create the objective:
to teleport the villager in front of the player:
and the for the detection, something like this:
Command block engineer // Developer // #TeamTrees