| Name | player right clicks entity |
| Event Lines | player right clicks <entity> |
| Triggers | when a player right clicks on an entity. |
| Generated Examples | after player right clicks entity:
on player right clicks monster: |
| Has Player | Always. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link. |
| Switches | with:<item> to only process the event when the player is holding a specified item.
type:<entity> to only run if the entity clicked matches the entity input. |
| Contexts | <context.entity> returns the EntityTag the player is clicking on.
<context.item> returns the ItemTag the player is clicking with.
<context.hand> returns "offhand" or "mainhand" to indicate which hand was used to fire the event. Some events fire twice - once for each hand.
<context.click_position> returns a LocationTag of the click position (as a world-less vector, relative to the entity's center). This is only available when clicking armor stands.
|
| Cancellable | True - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false' |
| Has Location | True - This adds the switches 'in:<area>', 'location_flagged:<flag>', ... |
| Group | Player |
| Warning(s) | this event may in some cases double-fire, requiring usage of the 'ratelimit' command (like 'ratelimit <player> 1t') to prevent doubling actions. |
| Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRightClicksEntityScriptEvent.java#L21 |