im recently making a spawners plugin, but im having a problem on setting spawner's entity id, PHP: $pos = new Vector3($x, $y, $z); $tile = $level->getTile($pos); if($tile instanceof MobSpawner) { $type = $this->getPlug()->type[$player->getName()]; if($type == "zombies") { $tile->setEntityId(54); } And call it on Block place event, but console keep returning: call to a member function spawnToAll() on null, i tried to fix it but nothing change. Please help as soon as possible
Is this your code? If so we need all the code your using so we can help you fix your issue, we don't know how your using spawnToAll(). EDIT: If your trying to use spawnToAll() to add a tile your not adding it correctly. Create a tile and use Level::addTile() to add your tile.
Nope, i add that in my task, repeating task every 20 ticks, it will detect the tile that player spawn in BlockPlaceEvent, then store that block's coordinates in public variables, then setEntityId to that tile :/