Skip to content

Instantly share code, notes, and snippets.

@ucchyocean
Created October 4, 2014 15:32
Show Gist options
  • Save ucchyocean/ae5ed4ed381950410f58 to your computer and use it in GitHub Desktop.
Save ucchyocean/ae5ed4ed381950410f58 to your computer and use it in GitHub Desktop.
ウィザーのドロップを全て無くす
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2014
*/
package org.bitbucket.ucchy;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.plugin.java.JavaPlugin;
/**
* DisableWitherDrop
* @author ucchy
*/
public class DisableWitherDrop extends JavaPlugin implements Listener {
/**
* @see org.bukkit.plugin.java.JavaPlugin#onEnable()
*/
@Override
public void onEnable() {
// イベントハンドラーの登録
getServer().getPluginManager().registerEvents(this, this);
}
/**
* MOBが死亡したときのイベント
* @param event
*/
@EventHandler
public void onEntityDeath(EntityDeathEvent event) {
if ( event.getEntityType() == EntityType.WITHER ) {
// ドロップを無くす
event.getDrops().clear();
// 経験値を無くす
event.setDroppedExp(0);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment