InteractEvent

The Interact Event is an event called when a player interacts with a block or entity by right-clicking it.

Description
The InteractEvent is a class that adds four local variables: an itemstack that keeps track of the item that was used to right click, the potential block that was interacted with, the potential entity that was interacted with, and the type of interaction. The types of interaction are AIR, BLOCK, and ENTITY.

Constructor
InteractEvent(Player who, EnchantmentLevel enchantment, ItemStack item) InteractEvent(Player who, EnchantmentLevel enchantment, ItemStack item, Block block) InteractEvent(Player who, EnchantmentLevel enchantment, ItemStack item, Entity entity)
 * // Player who - the player interacting
 * // EnchantmentLevel enchantment - the enchantment and level modifying the interaction
 * // ItemStack item - the item doing the interacting
 * * This constructor will set the type of interaction to AIR
 * // Player who - the player interacting
 * // EnchantmentLevel enchantment - the enchantment and level modifying the interaction
 * // ItemStack item - the item doing the interacting
 * // Block block - the block being interacted with
 * * This constructor will set the type of interaction to BLOCK
 * // Player who - the player interacting
 * // EnchantmentLevel enchantment - the enchantment and level modifying the interaction
 * // ItemStack item - the item doing the interacting
 * // Entity entity - the entity being interacted with
 * * This constructor will set the type of interaction to ENTITY

Implements
None

Extends
ESPlayerEvent

ItemStack getItem
Gets the item that is doing the interacting

Block getBlock
Gets the block being interacted with. Returns null when getType == ENTITY or getType == AIR

Entity getEntity
Gets the entity being interacted with. Returns null when getType == BLOCK or getType == AIR

Type getType
Gets the type of interaction