Class WrapperPlayServerSpawnEntity

java.lang.Object
com.comphenix.packetwrapper.AbstractPacket
com.comphenix.packetwrapper.WrapperPlayServerSpawnEntity

public class WrapperPlayServerSpawnEntity extends AbstractPacket
  • Field Details

    • TYPE

      public static final com.comphenix.protocol.PacketType TYPE
  • Constructor Details

    • WrapperPlayServerSpawnEntity

      public WrapperPlayServerSpawnEntity()
    • WrapperPlayServerSpawnEntity

      public WrapperPlayServerSpawnEntity(com.comphenix.protocol.events.PacketContainer packet)
    • WrapperPlayServerSpawnEntity

      public WrapperPlayServerSpawnEntity(org.bukkit.entity.Entity entity, int type, int objectData)
  • Method Details

    • getEntityID

      public int getEntityID()
      Retrieve entity ID of the Object.
      Returns:
      The current EID
    • getEntity

      public org.bukkit.entity.Entity getEntity(org.bukkit.World world)
      Retrieve the entity that will be spawned.
      Parameters:
      world - - the current world of the entity.
      Returns:
      The spawned entity.
    • getEntity

      public org.bukkit.entity.Entity getEntity(com.comphenix.protocol.events.PacketEvent event)
      Retrieve the entity that will be spawned.
      Parameters:
      event - - the packet event.
      Returns:
      The spawned entity.
    • setEntityID

      public void setEntityID(int value)
      Set entity ID of the Object.
      Parameters:
      value - - new value.
    • getUniqueId

      public UUID getUniqueId()
    • setUniqueId

      public void setUniqueId(UUID value)
    • getX

      public double getX()
      Retrieve the x position of the object.

      Note that the coordinate is rounded off to the nearest 1/32 of a meter.

      Returns:
      The current X
    • setX

      public void setX(double value)
      Set the x position of the object.
      Parameters:
      value - - new value.
    • getY

      public double getY()
      Retrieve the y position of the object.

      Note that the coordinate is rounded off to the nearest 1/32 of a meter.

      Returns:
      The current y
    • setY

      public void setY(double value)
      Set the y position of the object.
      Parameters:
      value - - new value.
    • getZ

      public double getZ()
      Retrieve the z position of the object.

      Note that the coordinate is rounded off to the nearest 1/32 of a meter.

      Returns:
      The current z
    • setZ

      public void setZ(double value)
      Set the z position of the object.
      Parameters:
      value - - new value.
    • getOptionalSpeedX

      public double getOptionalSpeedX()
      Retrieve the optional speed x.

      This is ignored if getObjectData() is zero.

      Returns:
      The optional speed x.
    • setOptionalSpeedX

      public void setOptionalSpeedX(double value)
      Set the optional speed x.
      Parameters:
      value - - new value.
    • getOptionalSpeedY

      public double getOptionalSpeedY()
      Retrieve the optional speed y.

      This is ignored if getObjectData() is zero.

      Returns:
      The optional speed y.
    • setOptionalSpeedY

      public void setOptionalSpeedY(double value)
      Set the optional speed y.
      Parameters:
      value - - new value.
    • getOptionalSpeedZ

      public double getOptionalSpeedZ()
      Retrieve the optional speed z.

      This is ignored if getObjectData() is zero.

      Returns:
      The optional speed z.
    • setOptionalSpeedZ

      public void setOptionalSpeedZ(double value)
      Set the optional speed z.
      Parameters:
      value - - new value.
    • getPitch

      public float getPitch()
      Retrieve the pitch.
      Returns:
      The current pitch.
    • setPitch

      public void setPitch(float value)
      Set the pitch.
      Parameters:
      value - - new pitch.
    • getYaw

      public float getYaw()
      Retrieve the yaw.
      Returns:
      The current Yaw
    • setYaw

      public void setYaw(float value)
      Set the yaw of the object spawned.
      Parameters:
      value - - new yaw.
    • getType

      public org.bukkit.entity.EntityType getType()
      Retrieve the type of object. See WrapperPlayServerSpawnEntity.ObjectTypes
      Returns:
      The current Type
    • setTypeFallingBlock

      public void setTypeFallingBlock(int combinedID)
      Set the type of object. See WrapperPlayServerSpawnEntity.ObjectTypes.
      Parameters:
      value - - new value.
    • getObjectData

      public int getObjectData()
      Retrieve object data.

      The content depends on the object type:

      Object Type: Name: Description
      ITEM_FRAME Orientation 0-3: South, West, North, East
      FALLING_BLOCK Block Type BlockID | (Metadata << 0xC)
      Projectiles Entity ID The entity ID of the thrower
      Splash Potions Data Value Potion data value.
      Returns:
      The current object Data
    • setObjectData

      public void setObjectData(int value)
      Set object Data.

      The content depends on the object type. See getObjectData() for more information.

      Parameters:
      value - - new object data.