clickAction Mechanic
Run commands, play sounds, or send messages when a player clicks a block or furniture.
Last updated
Run commands, play sounds, or send messages when a player clicks a block or furniture.
Last updated
To get started, create a basic or .
Next, under the mechanics section, you can add the default clickAction mechanic under any noteblock-mechanic, furniture-mechanic or stringblock-mechanic item.
With this setup, players will only trigger the console command say hello <player>
action if they have the permission test.permission
.
If you are not using conditions, you need to place brackets where they would be:
This mechanic does not support furniture with no hitbox.
Conditions are VERY configurable. You can use any of the "get" methods for Player or Server. See the Spigot Javadocs for all methods.
Additionally, the Spring Documentation is a good resource for understanding how to use condition expressions.
#server.getOnlinePlayers().size() > 10
#server.getAllowEnd()
#server.getDefaultGameMode()
#player.world.name == 'world'
#player.hasPermission("test.permission")
#player.gamemode.name() == 'ADVENTURE'
[console] <command>
[player] <command>
[message] <message>
[actionbar] <message>
{source=SOURCE volume=VOLUME pitch=PITCH} [sound] <sound name>
[console] say hello
[player] say hello
[message] <blue>Hello!
[actionbar] <gray>Hello from the actionbar!
{source=AMBIENT volume=0.1 pitch=1} [sound] minecraft:block.shulker_box.close