Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.event.entity.CreatureSpawnEvent Class Reference
Inheritance diagram for org.bukkit.event.entity.CreatureSpawnEvent:
org.bukkit.event.entity.EntityEvent org.bukkit.event.Cancellable org.bukkit.event.Event

Classes

enum  SpawnReason
 

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 ()
 
CreatureType getCreatureType ()
 
SpawnReason getSpawnReason ()
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.entity.EntityEvent
 EntityEvent (final Entity what)
 
Entity getEntity ()
 
EntityType getEntityType ()
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 
 Event (boolean isAsync)
 
String getEventName ()
 
abstract HandlerList getHandlers ()
 
final boolean isAsynchronous ()
 

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.

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 61 of file CreatureSpawnEvent.java.

References org.bukkit.event.entity.EntityEvent.getEntityType().

61  {
62  return CreatureType.fromEntityType(getEntityType());
63  }
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.entity.Entity.getLocation().

49  {
50  return getEntity().getLocation();
51  }
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 71 of file CreatureSpawnEvent.java.

71  {
72  return spawnReason;
73  }
boolean org.bukkit.event.entity.CreatureSpawnEvent.isCancelled ( )

Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

Returns
true if this event is cancelled

Implements org.bukkit.event.Cancellable.

Definition at line 31 of file CreatureSpawnEvent.java.

31  {
32  return canceled;
33  }
void org.bukkit.event.entity.CreatureSpawnEvent.setCancelled ( boolean  cancel)

Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Parameters
canceltrue if you wish to cancel this event

Implements org.bukkit.event.Cancellable.

Definition at line 35 of file CreatureSpawnEvent.java.

35  {
36  canceled = cancel;
37  }

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