Function of Players
players.on_click
Calls fn on a left or right click; hit holds the button and the entity, player, block and face it met.
players.on_click(fn: (player: Player, hit: Hit) -> ()) → Connection
Parameters
Returns
ConnectionUsed in
players.on_click(function(player, hit)Scoreboard with a buttonplayers.on_click(function(player, hit) end) -> connectionInput- A click while holding a slot fires `players.on_click` with `hit.slot`Hotbar menushit.slot -- on every players.on_click, 1..9Hotbar menus- `players.on_click` still gets the click, with the frame's `entity_id` andScreensd.id -- entity id, what players.on_click reports in hit.entity_idDisplays`players.on_click`. Clients below 1.19.4 get no hitbox.Displaysn.id -- entity id, what players.on_click reports in hit.entity_idNPCs