Deleting pig spawners

In my server I have a plugin that lets players mine spawners and get them. Somehow players managed to get pig spawners and I am having trouble of how could I delete all item ones and placed ones.
35 Replies
Admincraft Meta
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close !close !solved !answered
Requested by 240c#0
1who¡ssus?
1who¡ssus?2y ago
Tell your players I guess?
1who¡ssus?
1who¡ssus?2y ago
Modrinth
AntiBlockPlace - Minecraft Plugin
Configurable list of blocks that will be unable to be placed
1who¡ssus?
1who¡ssus?2y ago
This plugin should allow you to make a rule to block pig spawners to be placed iirc If it allows to block a certain type of spawner & not all of them @ProGamingDK can it? Being able to mine spawners is not suggested btw Maybe your plugin broke and gave a pig spawner to the players
ProGamingDk
ProGamingDk2y ago
should be able to block spawners in general from being placed
1who¡ssus?
1who¡ssus?2y ago
Can it block just a certain type?
ProGamingDk
ProGamingDk2y ago
it goes off spigot materials so probably not, just read the post and yeah might not work for his usecase
1who¡ssus?
1who¡ssus?2y ago
I'd block spawner placement And if players wanted to place them they have to ask and admin But they can mine them for proof of having a spawner @240c just purge all spawners with world edit //replacenear 300 spawner air In every base
240c
240cOP2y ago
I need the normal spawners to stay.
1who¡ssus?
1who¡ssus?2y ago
You can make a plugin to disable certain mobs from spawning from spawners I'd make it but idk how lol
240c
240cOP2y ago
I would make one if I would know too.
Discount Milk
Discount Milk2y ago
Well, you might be able to find all the pig spawners by searching the world for spawners with the same NBT data.
ProGamingDk
ProGamingDk2y ago
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/CreatureSpawnEvent.SpawnReason.html seems like a plugin for it wouldn't be too hard and I might be able to make it when I get home later
CreatureSpawnEvent.SpawnReason (Spigot-API 1.20.1-R0.1-SNAPSHOT API)
declaration: package: org.bukkit.event.entity, class: CreatureSpawnEvent, enum: SpawnReason
ProGamingDk
ProGamingDk2y ago
(disabling spawns from pig spawners)
240c
240cOP2y ago
That would be amazing.
ProGamingDk
ProGamingDk2y ago
ill attempt to make it in like 20 minutes or so what version of mc?
240c
240cOP2y ago
1.20.1
ProGamingDk
ProGamingDk2y ago
paper?
240c
240cOP2y ago
Yes
ProGamingDk
ProGamingDk2y ago
i should be done sending in dms
1who¡ssus?
1who¡ssus?2y ago
Make an addon to be able to disable certain spawners in config hehe Not just pigs
ProGamingDk
ProGamingDk2y ago
well sure i could edit it and then upload it to modrinth
1who¡ssus?
1who¡ssus?2y ago
I'm certainly sure some ppl would want it
ProGamingDk
ProGamingDk2y ago
i would need a name kek naming is what im horrible at + descriptions
QarthO
QarthO2y ago
AntiSpawners
1who¡ssus?
1who¡ssus?2y ago
Per-mob spawner disable
- An addon for my plugin that allows you to disable via config the spawn of whatever entity you choose from spawners.
ProGamingDk
ProGamingDk2y ago
oh you mean a antiblockplace addon?
1who¡ssus?
1who¡ssus?2y ago
Well I thought it needed antiblockplace to work 🤣 antiPerMobSpawner
ProGamingDk
ProGamingDk2y ago
its 3-4... lines of actual code
1who¡ssus?
1who¡ssus?2y ago
Amazing
ProGamingDk
ProGamingDk2y ago
lmao doing the configurable list rn
1who¡ssus?
1who¡ssus?2y ago
In forge it would not be 4 lines 😔✊
ProGamingDk
ProGamingDk2y ago
@Override
public void onEnable() {
saveDefaultConfig();
// Plugin startup logic
Bukkit.getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onSpawnEvent(CreatureSpawnEvent event) {
List<String> entitytype = getConfig().getStringList("entitytype");
if (entitytype.contains(event.getEntityType().toString()) && event.getSpawnReason().equals(CreatureSpawnEvent.SpawnReason.SPAWNER)) {
event.setCancelled(true);
}
}
@Override
public void onEnable() {
saveDefaultConfig();
// Plugin startup logic
Bukkit.getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onSpawnEvent(CreatureSpawnEvent event) {
List<String> entitytype = getConfig().getStringList("entitytype");
if (entitytype.contains(event.getEntityType().toString()) && event.getSpawnReason().equals(CreatureSpawnEvent.SpawnReason.SPAWNER)) {
event.setCancelled(true);
}
}
basically most of the code
ProGamingDk
ProGamingDk2y ago
No description
ProGamingDk
ProGamingDk2y ago
config indeed, but i should be finished with it added a reload command aswell just because

Did you find this page helpful?