Add config for disabling enderman grief
parent
2e72736571
commit
02562d7324
|
@ -104,6 +104,7 @@ public class QoL extends JavaPlugin {
|
|||
new BlockIgniteListener(this);
|
||||
new CommandPreprocessListener(this);
|
||||
new DeathListener(this);
|
||||
new EntityChangeBlockListener(this);
|
||||
|
||||
// Add commands
|
||||
new MainCommand(this);
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package xyz.etztech.qol.listeners;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import xyz.etztech.qol.QoL;
|
||||
|
||||
public class EntityChangeBlockListener implements Listener {
|
||||
QoL plugin;
|
||||
|
||||
public EntityChangeBlockListener(QoL plugin) {
|
||||
this.plugin = plugin;
|
||||
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onEntityChangeBlock(EntityChangeBlockEvent e) {
|
||||
if (e.getEntity().getType() == EntityType.ENDERMAN) {
|
||||
if(plugin.getConfig().getBoolean("disable-mob-grief.enderman") ){
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -93,6 +93,9 @@ disable-fire:
|
|||
ender_crystal: false
|
||||
explosion: false
|
||||
|
||||
disable-mob-grief:
|
||||
enderman: false
|
||||
|
||||
# A list of commands to confirm before using if the user isn't in spectator mode
|
||||
spec-confirm:
|
||||
- "tp"
|
||||
|
|
Loading…
Reference in New Issue