GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
Skull Class Reference

Public Member Functions

 __construct (Level $level, CompoundTag $nbt)
 
 setType (int $type)
 
 getType ()
 
 saveNBT ()
 
 getSpawnCompound ()
 
- Public Member Functions inherited from Spawnable
 spawnTo (Player $player)
 
 __construct (Level $level, CompoundTag $nbt)
 
 spawnToAll ()
 
 getSpawnCompound ()
 
 updateCompoundTag (CompoundTag $nbt, Player $player)
 
- Public Member Functions inherited from Tile
 getSaveId ()
 
 __construct (Level $level, CompoundTag $nbt)
 
 getId ()
 
 saveNBT ()
 
 getBlock ()
 
 onUpdate ()
 
 scheduleUpdate ()
 
 __destruct ()
 
 close ()
 
 getName ()
 
- Public Member Functions inherited from Position
 __construct ($x=0, $y=0, $z=0, Level $level=null)
 
 asPosition ()
 
 add ($x, $y=0, $z=0)
 
 getLevel ()
 
 setLevel (Level $level=null)
 
 isValid ()
 
 getSide ($side, $step=1)
 
 __toString ()
 
 setComponents ($x, $y, $z)
 
 fromObjectAdd (Vector3 $pos, $x, $y, $z)
 
- Public Member Functions inherited from Vector3
 __construct ($x=0, $y=0, $z=0)
 
 getX ()
 
 getY ()
 
 getZ ()
 
 getFloorX ()
 
 getFloorY ()
 
 getFloorZ ()
 
 getRight ()
 
 getUp ()
 
 getForward ()
 
 getSouth ()
 
 getWest ()
 
 add ($x, $y=0, $z=0)
 
 subtract ($x=0, $y=0, $z=0)
 
 multiply ($number)
 
 divide ($number)
 
 ceil ()
 
 floor ()
 
 round ()
 
 abs ()
 
 getSide ($side, $step=1)
 
 asVector3 ()
 
 distance (Vector3 $pos)
 
 distanceSquared (Vector3 $pos)
 
 maxPlainDistance ($x=0, $z=0)
 
 length ()
 
 lengthSquared ()
 
 normalize ()
 
 dot (Vector3 $v)
 
 cross (Vector3 $v)
 
 equals (Vector3 $v)
 
 getIntermediateWithXValue (Vector3 $v, $x)
 
 getIntermediateWithYValue (Vector3 $v, $y)
 
 getIntermediateWithZValue (Vector3 $v, $z)
 
 setComponents ($x, $y, $z)
 
 fromObjectAdd (Vector3 $pos, $x, $y, $z)
 
 __toString ()
 

Data Fields

const TYPE_SKELETON = 0
 
const TYPE_WITHER = 1
 
const TYPE_ZOMBIE = 2
 
const TYPE_HUMAN = 3
 
const TYPE_CREEPER = 4
 
const TYPE_DRAGON = 5
 
- Data Fields inherited from Tile
const BREWING_STAND = "BrewingStand"
 
const CHEST = "Chest"
 
const DL_DETECTOR = "DayLightDetector"
 
const ENCHANT_TABLE = "EnchantTable"
 
const FLOWER_POT = "FlowerPot"
 
const FURNACE = "Furnace"
 
const MOB_SPAWNER = "MobSpawner"
 
const SIGN = "Sign"
 
const SKULL = "Skull"
 
const ITEM_FRAME = "ItemFrame"
 
const DISPENSER = "Dispenser"
 
const DROPPER = "Dropper"
 
const CAULDRON = "Cauldron"
 
const HOPPER = "Hopper"
 
const BEACON = "Beacon"
 
const ENDER_CHEST = "EnderChest"
 
const BED = "Bed"
 
const DAY_LIGHT_DETECTOR = "DLDetector"
 
 $chunk
 
 $name
 
 $id
 
 $x
 
 $y
 
 $z
 
 $attach
 
 $metadata
 
 $closed = false
 
 $namedtag
 
 $tickTimer
 
- Data Fields inherited from Position
 $level = null
 
- Data Fields inherited from Vector3
const SIDE_DOWN = 0
 
const SIDE_UP = 1
 
const SIDE_NORTH = 2
 
const SIDE_SOUTH = 3
 
const SIDE_WEST = 4
 
const SIDE_EAST = 5
 
 $x
 
 $y
 
 $z
 

Additional Inherited Members

- Static Public Member Functions inherited from Tile
static init ()
 
static createTile ($type, Level $level, CompoundTag $nbt,... $args)
 
static registerTile ($className)
 
- Static Public Member Functions inherited from Position
static fromObject (Vector3 $pos, Level $level=null)
 
- Static Public Member Functions inherited from Vector3
static getOppositeSide ($side)
 
static createRandomDirection (Random $random)
 
- Static Public Attributes inherited from Tile
static $tileCount = 1
 
- Protected Member Functions inherited from Spawnable
 onChanged ()
 
- Protected Attributes inherited from Tile
 $lastUpdate
 
 $server
 
 $timings
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( Level  $level,
CompoundTag  $nbt 
)

Skull constructor.

Parameters
Level$level
CompoundTag$nbt
45  {
46  if(!isset($nbt->SkullType)){
47  $nbt->SkullType = new ByteTag("SkullType", 0);
48  }
49  if(!isset($nbt->Rot) or !($nbt->Rot instanceof ByteTag)){
50  $nbt->Rot = new ByteTag("Rot", 0);
51  }
52  parent::__construct($level, $nbt);
53  }

Member Function Documentation

◆ getSpawnCompound()

getSpawnCompound ( )
Returns
CompoundTag
84  {
85  return new CompoundTag("", [
86  new StringTag("id", Tile::SKULL),
87  $this->namedtag->SkullType,
88  $this->namedtag->Rot,
89  new IntTag("x", (int) $this->x),
90  new IntTag("y", (int) $this->y),
91  new IntTag("z", (int) $this->z),
92  ]);
93  }

◆ getType()

getType ( )
Returns
null
72  {
73  return $this->namedtag["SkullType"];
74  }

◆ saveNBT()

saveNBT ( )
76  {
77  parent::saveNBT();
78  unset($this->namedtag->Creator);
79  }

◆ setType()

setType ( int  $type)
Parameters
int$type
Returns
bool
60  {
61  if($type >= 0 && $type <= 4){
62  $this->namedtag->SkullType = new ByteTag("SkullType", $type);
63  $this->onChanged();
64  return true;
65  }
66  return false;
67  }

Field Documentation

◆ TYPE_CREEPER

const TYPE_CREEPER = 4

◆ TYPE_DRAGON

const TYPE_DRAGON = 5

◆ TYPE_HUMAN

const TYPE_HUMAN = 3

◆ TYPE_SKELETON

const TYPE_SKELETON = 0

◆ TYPE_WITHER

const TYPE_WITHER = 1

◆ TYPE_ZOMBIE

const TYPE_ZOMBIE = 2

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