Towny Classic

Towny Classic

3.2k Downloads

Suggestion: Summon Command With Town Mobs Off

TylorTurner opened this issue ยท 2 comments

commented

Please explain your feature request to the best of your abilities:

While the Town mobs are off I cannot use the summon command. Is it possible to allow mobs that are summoned with a command to be ignored by Towny?

commented

That would be a bit tricky, since even if we did not destroy the mob on spawn, the mob removal timer task that sweeps the world every X seconds would also mark the mob for removal.

One option is to use the named-mobs-bypass-removal option in towny, if you're summoning a special mob from a mob-plugin usually they have a nametag, and then they wont ever be removed by Towny, (on spawn or subsequent timer removals.)

commented

This is possible to do by using paper's https://jd.papermc.io/paper/1.20/org/bukkit/entity/Entity.html#getEntitySpawnReason() method, and checking if it's spawned with the COMMAND cause.