Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.event.player.PlayerEggThrowEvent Class Reference

Called when a player throws an egg and it might hatch. More...

+ Inheritance diagram for org.bukkit.event.player.PlayerEggThrowEvent:
+ Collaboration diagram for org.bukkit.event.player.PlayerEggThrowEvent:

Public Member Functions

 PlayerEggThrowEvent (final Player player, final Egg egg, final boolean hatching, final byte numHatches, final EntityType hatchingType)
 
 PlayerEggThrowEvent (Player player, Egg egg, boolean hatching, byte numHatches, CreatureType hatchingType)
 
Egg getEgg ()
 Gets the egg involved in this event.
 
boolean isHatching ()
 Gets whether the egg is hatching or not.
 
void setHatching (boolean hatching)
 Sets whether the egg will hatch or not.
 
CreatureType getHatchType ()
 Get the type of the mob being hatched (EntityType.CHICKEN by default)
 
EntityType getHatchingType ()
 Get the type of the mob being hatched (EntityType.CHICKEN by default)
 
void setHatchType (CreatureType hatchType)
 Change the type of mob being hatched by the egg.
 
void setHatchingType (EntityType hatchType)
 Change the type of mob being hatched by the egg.
 
byte getNumHatches ()
 Get the number of mob hatches from the egg.
 
void setNumHatches (byte numHatches)
 Change the number of mobs coming out of the hatched egg.
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.player.PlayerEvent
 PlayerEvent (final Player who)
 
final Player getPlayer ()
 Returns the player involved in this event.
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 The default constructor is defined for cleaner code.
 
 Event (boolean isAsync)
 This constructor is used to explicitly declare an event as synchronous or asynchronous.
 
String getEventName ()
 
final boolean isAsynchronous ()
 Any custom event that should not by synchronized with other events must use the specific constructor.
 

Static Public Member Functions

static HandlerList getHandlerList ()
 

Additional Inherited Members

- Protected Attributes inherited from org.bukkit.event.player.PlayerEvent
Player player
 

Detailed Description

Called when a player throws an egg and it might hatch.

Definition at line 12 of file PlayerEggThrowEvent.java.

Constructor & Destructor Documentation

org.bukkit.event.player.PlayerEggThrowEvent.PlayerEggThrowEvent ( final Player  player,
final Egg  egg,
final boolean  hatching,
final byte  numHatches,
final EntityType  hatchingType 
)

Definition at line 19 of file PlayerEggThrowEvent.java.

org.bukkit.event.player.PlayerEggThrowEvent.PlayerEggThrowEvent ( Player  player,
Egg  egg,
boolean  hatching,
byte  numHatches,
CreatureType  hatchingType 
)

Member Function Documentation

Egg org.bukkit.event.player.PlayerEggThrowEvent.getEgg ( )

Gets the egg involved in this event.

Returns
the egg involved in this event

Definition at line 37 of file PlayerEggThrowEvent.java.

static HandlerList org.bukkit.event.player.PlayerEggThrowEvent.getHandlerList ( )
static

Definition at line 133 of file PlayerEggThrowEvent.java.

HandlerList org.bukkit.event.player.PlayerEggThrowEvent.getHandlers ( )
virtual

Implements org.bukkit.event.Event.

Definition at line 129 of file PlayerEggThrowEvent.java.

EntityType org.bukkit.event.player.PlayerEggThrowEvent.getHatchingType ( )

Get the type of the mob being hatched (EntityType.CHICKEN by default)

Returns
The type of the mob being hatched by the egg

Definition at line 77 of file PlayerEggThrowEvent.java.

CreatureType org.bukkit.event.player.PlayerEggThrowEvent.getHatchType ( )

Get the type of the mob being hatched (EntityType.CHICKEN by default)

Returns
The type of the mob being hatched by the egg
Deprecated:
In favour of getHatchingType().

Definition at line 68 of file PlayerEggThrowEvent.java.

References org.bukkit.entity.CreatureType.fromEntityType().

byte org.bukkit.event.player.PlayerEggThrowEvent.getNumHatches ( )

Get the number of mob hatches from the egg.

By default the number will be he number the server would've done

7/8 chance of being 0 31/256 ~= 1/8 chance to be 1 1/256 chance to be 4

Returns
The number of mobs going to be hatched by the egg

Definition at line 112 of file PlayerEggThrowEvent.java.

boolean org.bukkit.event.player.PlayerEggThrowEvent.isHatching ( )

Gets whether the egg is hatching or not.

Will be what the server would've done without interaction.

Returns
boolean Whether the egg is going to hatch or not

Definition at line 47 of file PlayerEggThrowEvent.java.

void org.bukkit.event.player.PlayerEggThrowEvent.setHatching ( boolean  hatching)

Sets whether the egg will hatch or not.

Parameters
hatchingtrue if you want the egg to hatch false if you want it not to

Definition at line 57 of file PlayerEggThrowEvent.java.

void org.bukkit.event.player.PlayerEggThrowEvent.setHatchingType ( EntityType  hatchType)

Change the type of mob being hatched by the egg.

Parameters
hatchTypeThe type of the mob being hatched by the egg

Definition at line 97 of file PlayerEggThrowEvent.java.

References org.bukkit.entity.EntityType.isSpawnable().

void org.bukkit.event.player.PlayerEggThrowEvent.setHatchType ( CreatureType  hatchType)

Change the type of mob being hatched by the egg.

Parameters
hatchTypeThe type of the mob being hatched by the egg
Deprecated:
In favour of setHatchingType(EntityType).

Definition at line 88 of file PlayerEggThrowEvent.java.

References org.bukkit.entity.CreatureType.toEntityType().

void org.bukkit.event.player.PlayerEggThrowEvent.setNumHatches ( byte  numHatches)

Change the number of mobs coming out of the hatched egg.

The boolean hatching will override this number. Ie. If hatching = false, this number will not matter

Parameters
numHatchesThe number of mobs coming out of the egg

Definition at line 124 of file PlayerEggThrowEvent.java.


The documentation for this class was generated from the following file: