Can now have the mob they spawn change by placing the corresponding spawn egg

This commit is contained in:
Lord Cambion
2026-03-17 01:28:12 +01:00
parent 1494f4fe5b
commit 0c143b9bd8
3 changed files with 42 additions and 9 deletions
+23
View File
@@ -99,4 +99,27 @@ shared_ptr<TileEntity> MobSpawnerTileEntity::clone()
void MobSpawnerTileEntity::setEntityId(const wstring &id)
{
spawner->setEntityId(id);
if (spawner != nullptr)
{
spawner->spawnDelay = 20;
}
if (level != nullptr)
{
level->sendTileUpdated(x, y, z);
}
}
void MobSpawnerTileEntity::setEntityIdFromEgg(const wstring &id)
{
spawner->setEntityId(id);
if (level != nullptr) {
level->sendTileUpdated(x, y, z);
}
}