Skip to content

Click Actions

Click actions allow holograms to respond when players interact with them. Actions are defined per-page and per-click type.

Click Types

Click Type Trigger
LEFT Left-click (attack)
RIGHT Right-click (interact)
SHIFT_LEFT Shift + left-click
SHIFT_RIGHT Shift + right-click

Managing Actions

Add an Action

/mh page addaction <hologram> <page> <clickType> <action>

Remove an Action

/mh page removeaction <hologram> <page> <clickType> <index>

The index is 1-based. Use actions to see the index of each action.

Clear All Actions

/mh page clearactions <hologram> <page> <clickType>

List Actions

/mh page actions <hologram> <page> <clickType>

Action Types

MESSAGE

Sends a chat message to the clicking player. Supports color codes.

MESSAGE:&aYou clicked the hologram!
MESSAGE:&6Welcome to the shop, {player}!

Info

The {player} placeholder is replaced with the clicking player's username in MESSAGE actions.

COMMAND

Executes a command as the clicking player.

COMMAND:/spawn
COMMAND:/warp shop
COMMAND:/msg Steve Hello!

The command runs with the player's own permissions. Include the leading /.

CONSOLE

Executes a command as the server console. Use {player} for the clicking player's name.

CONSOLE:give {player} diamond 1
CONSOLE:effect give {player} minecraft:speed 60 1
CONSOLE:broadcast {player} clicked the hologram!

Warning

Console commands run with full server permissions. Be careful with what commands you expose to players via hologram clicks.

TELEPORT

Teleports the player to specified coordinates.

TELEPORT:minecraft:overworld:100:65:-200
TELEPORT:minecraft:the_nether:50:70:50
TELEPORT:minecraft:the_end:0:64:0

Format: TELEPORT:dimension:x:y:z

The dimension is the full namespace (e.g., minecraft:overworld).

SOUND

Plays a sound for the clicking player.

SOUND:minecraft:entity.experience_orb.pickup:1.0:1.0
SOUND:minecraft:block.note_block.pling:0.5:2.0
SOUND:minecraft:ui.button.click:1.0:1.0

Format: SOUND:sound_name:volume:pitch

Parameter Range Description
sound_name Any valid sound event Minecraft sound resource location
volume 0.0+ Volume (1.0 = normal, higher = louder/further)
pitch 0.5-2.0 Pitch (1.0 = normal, 2.0 = high, 0.5 = low)

PERMISSION

Gates the action chain — if the player doesn't have the permission, all following actions are skipped.

PERMISSION:my.server.vip

This is useful for creating VIP-only click actions:

/mh page addaction shop 1 RIGHT PERMISSION:my.server.vip
/mh page addaction shop 1 RIGHT MESSAGE:&aWelcome, VIP!
/mh page addaction shop 1 RIGHT COMMAND:/vip-shop

If the player doesn't have my.server.vip, neither the message nor the command executes.

NEXT_PAGE

Shows the next page of the hologram. Wraps from the last page back to page 1.

NEXT_PAGE

PREV_PAGE

Shows the previous page. Wraps from page 1 to the last page.

PREV_PAGE

PAGE

Jumps to a specific page number (1-indexed).

PAGE:3

NONE

Does nothing. Can be used as a placeholder.

NONE

Action Chains

When a player clicks, all actions for that click type execute in order. If any action returns false (like a failed PERMISSION check), the chain stops and remaining actions are skipped.

Example: VIP Shop

# Right-click actions (executed in order):
/mh page addaction shop 1 RIGHT SOUND:minecraft:ui.button.click:1.0:1.0
/mh page addaction shop 1 RIGHT PERMISSION:my.server.vip
/mh page addaction shop 1 RIGHT MESSAGE:&aOpening VIP shop...
/mh page addaction shop 1 RIGHT COMMAND:/vip-shop

Execution flow: 1. Play click sound (always) 2. Check VIP permission - Has permission: continue to message and command - No permission: chain stops, no message or command

Example: Multi-Action Button

/mh page addaction portal 1 RIGHT SOUND:minecraft:block.portal.trigger:0.5:1.5
/mh page addaction portal 1 RIGHT MESSAGE:&5Teleporting...
/mh page addaction portal 1 RIGHT TELEPORT:minecraft:the_nether:0:70:0

Click Cooldown

A per-player cooldown prevents action spam. Default: 1 tick (0.05 seconds).

Configure in config.json:

{
  "clickCooldownTicks": 5
}

Setting to 5 means players can only trigger actions every 0.25 seconds.

Disabling Actions

Per Hologram

/mh hologram addflag myHolo DISABLE_ACTIONS

Note on Click Detection

Click detection works by intercepting ServerboundInteractPacket via a mixin. The server matches the clicked entity ID against all hologram entities (text armor stands, icon items, entity lines, and invisible clickable hitbox entities).

This means clicks work on any part of the hologram — text, icons, heads, and entities are all clickable.

Complete Example: Interactive Menu

# Create hologram
/mh hologram create menu

# Page 1 - Main Menu
/mh line set menu 1 1 &6&l=== Main Menu ===
/mh line add menu 1 #ICON:COMPASS
/mh line add menu 1 &eRight-click to browse
/mh line add menu 1 &7Shift+Right for VIP options

# Page 2 - Warps
/mh page add menu &b&l=== Warps ===
/mh line add menu 2 &7Left: Spawn | Right: Shop
/mh line add menu 2 &8Shift+Left: Back

# Page 3 - VIP
/mh page add menu &d&l=== VIP Menu ===
/mh line add menu 3 &7Right-click for rewards
/mh line add menu 3 &8Shift+Left: Back

# Page 1 actions
/mh page addaction menu 1 RIGHT NEXT_PAGE

/mh page addaction menu 1 SHIFT_RIGHT PERMISSION:server.vip
/mh page addaction menu 1 SHIFT_RIGHT PAGE:3

# Page 2 actions
/mh page addaction menu 2 LEFT COMMAND:/spawn
/mh page addaction menu 2 LEFT MESSAGE:&aTeleporting to spawn...

/mh page addaction menu 2 RIGHT COMMAND:/warp shop
/mh page addaction menu 2 RIGHT MESSAGE:&aTeleporting to shop...

/mh page addaction menu 2 SHIFT_LEFT PAGE:1

# Page 3 actions
/mh page addaction menu 3 RIGHT CONSOLE:give {player} diamond 1
/mh page addaction menu 3 RIGHT SOUND:minecraft:entity.experience_orb.pickup:1.0:1.0
/mh page addaction menu 3 RIGHT MESSAGE:&a+1 Diamond!

/mh page addaction menu 3 SHIFT_LEFT PAGE:1