RightClickEmptyEvent

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.neoforge.api.event.interact.RightClickEmptyEvent;

Description

The rightClickEmpty event is fired whenever the player right clicks with an empty hand. It does not offer any special getters, but you can still access all members from PlayerInteractEvent

Extends

RightClickEmptyEvent extends PlayerInteractEvent.

Listening to the event

This event can be listened to like so:

script.zs
events.register<crafttweaker.neoforge.api.event.interact.RightClickEmptyEvent>(event => {
println("RightClickEmptyEvent ran!");
});

Members

Getter
If the interaction was on an entity, will be a BlockPos centered on the entity. If the interaction was on a block, will be the position of that block. Otherwise, will be a BlockPos centered on the player.
script.zs
// RightClickEmpty.blockPos as BlockPos
event.blockPos

Return Type: BlockPos

Getter
script.zs
// RightClickEmpty.entity as Player
event.entity

Return Type: Player

Getter
script.zs
// RightClickEmpty.entity as LivingEntity
event.entity

Return Type: LivingEntity

Getter
script.zs
// RightClickEmpty.entity as Entity
event.entity

Return Type: Entity

Getter
The face involved in this interaction. For all non-block interactions, this will return null
script.zs
// RightClickEmpty.face as Direction
event.face

Return Type: Direction

Getter
script.zs
// RightClickEmpty.hand as InteractionHand
event.hand

Return Type: InteractionHand

Getter
The stack involved in this interaction. May be empty, but will never be null.
script.zs
// RightClickEmpty.itemStack as IItemStack
event.itemStack

Return Type: IItemStack