Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.material.SpawnEgg Class Reference
Inheritance diagram for org.bukkit.material.SpawnEgg:
org.bukkit.material.MaterialData

Public Member Functions

 SpawnEgg (int type, byte data)
 
 SpawnEgg (byte data)
 
 SpawnEgg (EntityType type)
 
EntityType getSpawnedType ()
 
void setSpawnedType (EntityType type)
 
String toString ()
 
SpawnEgg clone ()
 
- Public Member Functions inherited from org.bukkit.material.MaterialData
 MaterialData (final int type)
 
 MaterialData (final Material type)
 
 MaterialData (final int type, final byte data)
 
 MaterialData (final Material type, final byte data)
 
byte getData ()
 
void setData (byte data)
 
Material getItemType ()
 
int getItemTypeId ()
 
ItemStack toItemStack ()
 
ItemStack toItemStack (int amount)
 
String toString ()
 
int hashCode ()
 
boolean equals (Object obj)
 
MaterialData clone ()
 

Detailed Description

Represents a spawn egg that can be used to spawn mobs

Definition at line 9 of file SpawnEgg.java.

Constructor & Destructor Documentation

org.bukkit.material.SpawnEgg.SpawnEgg ( int  type,
byte  data 
)
Deprecated:
Magic value

Definition at line 20 of file SpawnEgg.java.

20  {
21  super(type, data);
22  }
org.bukkit.material.SpawnEgg.SpawnEgg ( byte  data)
Deprecated:
Magic value

Definition at line 29 of file SpawnEgg.java.

29  {
30  super(Material.MONSTER_EGG, data);
31  }

Member Function Documentation

EntityType org.bukkit.material.SpawnEgg.getSpawnedType ( )

Get the type of entity this egg will spawn.

Returns
The entity type.

Definition at line 43 of file SpawnEgg.java.

References org.bukkit.entity.EntityType.fromId(), and org.bukkit.material.MaterialData.getData().

43  {
44  return EntityType.fromId(getData());
45  }
void org.bukkit.material.SpawnEgg.setSpawnedType ( EntityType  type)

Set the type of entity this egg will spawn.

Parameters
typeThe entity type.

Definition at line 52 of file SpawnEgg.java.

References org.bukkit.entity.EntityType.getTypeId(), and org.bukkit.material.MaterialData.setData().

52  {
53  setData((byte) type.getTypeId());
54  }

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