OtherDrops

226k Downloads

Mobspawner group

kylebobert opened this issue ยท 1 comments

commented

I would be really useful to be able to tag any mob that spawned from a mob spawner to not drop any money or drops. Hopefully prevent people going afk at spawners for easy items and cash

commented

We have been using the plugin "MoneyDrops" until just recently we found your plugin.

I was looking through the java files and found, I hope this helps in adding this to the OtherDrop plugin. :) Thank you!

Moneydrops 2.2.0
Location: moneydrops/me/drakespirit/plugins/moneydrop/EventListener.java

import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;

public void onSpawn(CreatureSpawnEvent event) {
    String worldname = event.getEntity().getWorld().getName();
    WorldSettings world = moneydrop.getWorldSettings().get(worldname);
    if(world == null) {
        moneydrop.addWorldSettings(worldname);
        return;
    }
    if((! world.isMobspawnerDrops()) && event.getSpawnReason() == SpawnReason.SPAWNER) {
        event.getEntity().setMetadata("MDSpecialDrop", new MDSpecialDropMetaData(0, moneydrop));
    }
    else if((! world.isEggDrops()) && event.getSpawnReason() == SpawnReason.SPAWNER_EGG) {
        event.getEntity().setMetadata("MDSpecialDrop", new MDSpecialDropMetaData(0, moneydrop));
    }
    else if((! world.isModspawnerDrops()) && event.getSpawnReason() == SpawnReason.DEFAULT) {
        event.getEntity().setMetadata("MDSpecialDrop", new MDSpecialDropMetaData(0, moneydrop));
    }
    else if((! world.isPluginspawnerDrops()) && event.getSpawnReason() == SpawnReason.CUSTOM) {
        event.getEntity().setMetadata("MDSpecialDrop", new MDSpecialDropMetaData(0, moneydrop));
    }
}