Skip to content

Available Events

Matryoshika edited this page May 27, 2018 · 2 revisions

Preface

Please read the documentation on Parent|Child events here: Event
This is a WIP list. Almost all common or Server-side events are supported, they just need to be documented!


AnimalTameEvent

Fired whenever an EntityAnimal is tamed
Extends LivingEvent

Method: getAnimal()
Returns the EntityAnimal being tamed

Method: getTamer()
Returns the EntityPlayer that is taming


AnvilRepairEvent

Fired when a player removes a repaired ItemStack from the Anvil
Extends PlayerEvent

Method: getItemResult()
Returns the output ItemStack from the anvil

Method: getItemInput()
Returns the ItemStack being repaired

Method: getIngredientInput()
Returns the repair-material ItemStack used

Method: getBreakChance()
Returns a float representing the break chance

Method: setBreakChance(Float)
Returns void, sets the break chance


AnvilUpdateEvent

Fired when a player places ItemStacks in both the left and right slots of an anvil
Extends Event

Method: getLeft()
Returns the left slot's ItemStack

Method: getRight()
Returns the right slot's ItemStack

Method: getName()
Returns a string representing the name of the output

Method: getOutput()
Returns the ItemStack representing the output. Possible to be empty (air)

Method: setOutput(ItemStack)
Returns void, sets a new ItemStack as output

Method: getCost()
Returns the Integer representing the repair cost

Method: setCost(Integer)
Returns void, sets the repair cost

Method: getMaterialCost()
Returns an Integer representing the amount of items in the right slot to consume

Method: setMaterialCost(Integer)
Returns void, sets the amount of items to consume from the right slot


ArrowLooseEvent

Fired when a player stops using a bow (or similar draw-back item)
Extends PlayerEvent

Method: getBow()
Returns the Itemstack representing the bow that was used

Method: getWorld()
Returns the World in which this happened

Method: hasAmmo()
Returns a Boolean representing wether or not the player has any ammo

Method: getCharge()
Returns an Integer representing how much the player has drawn back

Method: setCharge(Integer) Returns void, sets how far back the player has drawn back


ArrowNockEvent

Fired when a player begins using a bow (or similar draw-back item)
Extends PlayerEvent

Method: getBow()
Returns the ItemStack representing the bow used

Method: getWorld()
Returns the World where this event was fired from

Method: getHand()
Returns an EnumHand representing which hand the bow is in

Method: hasAmmo()
Returns a Boolean representing wether or not the player has any ammo

Method: getAction()
Returns an ActionResult representing an EnumActionResult

Clone this wiki locally