A
Admincraft•2y ago
240c

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
Admincraft Meta•2y ago
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
CtrlAltDelMe
CtrlAltDelMe•2y ago
Tell your players I guess?
CtrlAltDelMe
CtrlAltDelMe•2y ago
Modrinth
AntiBlockPlace - Minecraft Plugin
Configurable list of blocks that will be unable to be placed
CtrlAltDelMe
CtrlAltDelMe•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
ProGamingDk•2y ago
should be able to block spawners in general from being placed
CtrlAltDelMe
CtrlAltDelMe•2y ago
Can it block just a certain type?
ProGamingDk
ProGamingDk•2y ago
it goes off spigot materials so probably not, just read the post and yeah might not work for his usecase
CtrlAltDelMe
CtrlAltDelMe•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
240cOP•2y ago
I need the normal spawners to stay.
CtrlAltDelMe
CtrlAltDelMe•2y ago
You can make a plugin to disable certain mobs from spawning from spawners I'd make it but idk how lol
240c
240cOP•2y ago
I would make one if I would know too.
Discount Milk
Discount Milk•2y ago
Well, you might be able to find all the pig spawners by searching the world for spawners with the same NBT data.
ProGamingDk
ProGamingDk•2y 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
ProGamingDk•2y ago
(disabling spawns from pig spawners)
240c
240cOP•2y ago
That would be amazing.
ProGamingDk
ProGamingDk•2y ago
ill attempt to make it in like 20 minutes or so what version of mc?
240c
240cOP•2y ago
1.20.1
ProGamingDk
ProGamingDk•2y ago
paper?
240c
240cOP•2y ago
Yes
ProGamingDk
ProGamingDk•2y ago
i should be done sending in dms
CtrlAltDelMe
CtrlAltDelMe•2y ago
Make an addon to be able to disable certain spawners in config hehe Not just pigs
ProGamingDk
ProGamingDk•2y ago
well sure i could edit it and then upload it to modrinth
CtrlAltDelMe
CtrlAltDelMe•2y ago
I'm certainly sure some ppl would want it
ProGamingDk
ProGamingDk•2y ago
i would need a name kek naming is what im horrible at + descriptions
QarthO
QarthO•2y ago
AntiSpawners
CtrlAltDelMe
CtrlAltDelMe•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
ProGamingDk•2y ago
oh you mean a antiblockplace addon?
CtrlAltDelMe
CtrlAltDelMe•2y ago
Well I thought it needed antiblockplace to work 🤣 antiPerMobSpawner
ProGamingDk
ProGamingDk•2y ago
its 3-4... lines of actual code
CtrlAltDelMe
CtrlAltDelMe•2y ago
Amazing
ProGamingDk
ProGamingDk•2y ago
lmao doing the configurable list rn
CtrlAltDelMe
CtrlAltDelMe•2y ago
In forge it would not be 4 lines 😔✊
ProGamingDk
ProGamingDk•2y 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
ProGamingDk•2y ago
No description
ProGamingDk
ProGamingDk•2y ago
config indeed, but i should be finished with it added a reload command aswell just because

Did you find this page helpful?