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

Called when a creature is spawned into a world. More...

+ Inheritance diagram for org.bukkit.event.entity.CreatureSpawnEvent:
+ Collaboration diagram for org.bukkit.event.entity.CreatureSpawnEvent:

Classes

enum  SpawnReason
 An enum to specify the type of spawning. More...
 

Public Member Functions

 CreatureSpawnEvent (final LivingEntity spawnee, final SpawnReason spawnReason)
 
 CreatureSpawnEvent (Entity spawnee, CreatureType type, Location loc, SpawnReason reason)
 
boolean isCancelled ()
 
void setCancelled (boolean cancel)
 
LivingEntity getEntity ()
 
Location getLocation ()
 Gets the location at which the creature is spawning.
 
CreatureType getCreatureType ()
 Gets the type of creature being spawned.
 
SpawnReason getSpawnReason ()
 Gets the reason for why the creature is being spawned.
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.entity.EntityEvent
 EntityEvent (final Entity what)
 
Entity getEntity ()
 Returns the Entity involved in this event.
 
EntityType getEntityType ()
 Gets the EntityType of the Entity 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.
 
- Public Member Functions inherited from org.bukkit.event.Cancellable
boolean isCancelled ()
 Gets the cancellation state of this event.
 
void setCancelled (boolean cancel)
 Sets the cancellation state of this event.
 

Static Public Member Functions

static HandlerList getHandlerList ()
 

Additional Inherited Members

- Protected Attributes inherited from org.bukkit.event.entity.EntityEvent
Entity entity
 

Detailed Description

Called when a creature is spawned into a world.

If a Creature Spawn event is cancelled, the creature will not spawn.

Definition at line 15 of file CreatureSpawnEvent.java.

Constructor & Destructor Documentation

org.bukkit.event.entity.CreatureSpawnEvent.CreatureSpawnEvent ( final LivingEntity  spawnee,
final SpawnReason  spawnReason 
)

Definition at line 20 of file CreatureSpawnEvent.java.

org.bukkit.event.entity.CreatureSpawnEvent.CreatureSpawnEvent ( Entity  spawnee,
CreatureType  type,
Location  loc,
SpawnReason  reason 
)

Definition at line 26 of file CreatureSpawnEvent.java.

Member Function Documentation

CreatureType org.bukkit.event.entity.CreatureSpawnEvent.getCreatureType ( )

Gets the type of creature being spawned.

Returns
A CreatureType value detailing the type of creature being spawned
Deprecated:
In favour of getEntityType().

Definition at line 60 of file CreatureSpawnEvent.java.

References org.bukkit.entity.CreatureType.fromEntityType(), and org.bukkit.event.entity.EntityEvent.getEntityType().

LivingEntity org.bukkit.event.entity.CreatureSpawnEvent.getEntity ( )
static HandlerList org.bukkit.event.entity.CreatureSpawnEvent.getHandlerList ( )
static

Definition at line 78 of file CreatureSpawnEvent.java.

HandlerList org.bukkit.event.entity.CreatureSpawnEvent.getHandlers ( )
virtual

Implements org.bukkit.event.Event.

Definition at line 74 of file CreatureSpawnEvent.java.

Location org.bukkit.event.entity.CreatureSpawnEvent.getLocation ( )

Gets the location at which the creature is spawning.

Returns
The location at which the creature is spawning

Definition at line 49 of file CreatureSpawnEvent.java.

References org.bukkit.event.entity.CreatureSpawnEvent.getEntity(), and org.bukkit.entity.Entity.getLocation().

SpawnReason org.bukkit.event.entity.CreatureSpawnEvent.getSpawnReason ( )

Gets the reason for why the creature is being spawned.

Returns
A SpawnReason value detailing the reason for the creature being spawned

Definition at line 69 of file CreatureSpawnEvent.java.

boolean org.bukkit.event.entity.CreatureSpawnEvent.isCancelled ( )

Definition at line 31 of file CreatureSpawnEvent.java.

void org.bukkit.event.entity.CreatureSpawnEvent.setCancelled ( boolean  cancel)

Definition at line 35 of file CreatureSpawnEvent.java.


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