Add config for disabling enderman grief

pull/14/head
Joey Hines 2021-07-19 19:39:22 -06:00
parent 2e72736571
commit 02562d7324
No known key found for this signature in database
GPG Key ID: 80F567B5C968F91B
3 changed files with 30 additions and 0 deletions

View File

@ -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);

View File

@ -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);
}
}
}
}

View File

@ -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"