Created
October 4, 2014 15:32
-
-
Save ucchyocean/ae5ed4ed381950410f58 to your computer and use it in GitHub Desktop.
ウィザーのドロップを全て無くす
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @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