clicking on spawner with egg will change a mob there

This commit is contained in:
GameHerobrine 2023-12-02 14:05:37 +03:00
parent 60fd866de6
commit ea3babff02
7 changed files with 23 additions and 3 deletions

View file

@ -5,7 +5,16 @@ class MonsterSpawnerBlock extends SolidBlock{
parent::__construct(MONSTER_SPAWNER, $meta, "Monster Spawner");
$this->hardness = 5;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
parent::place($item, $player, $block, $target, $face, $fx, $fy, $fz);
ServerAPI::request()->api->tile->add($this->level, TILE_MOB_SPAWNER, $this->x, $this->y, $this->z, [
"EntityId" => 0,
"id" => TILE_MOB_SPAWNER,
"x" => $this->x,
"y" => $this->y,
"z" => $this->z,
]);
}
public function getDrops(Item $item, Player $player){
return [];
}