add ExploitFix.PreventArmorStandInteraction to prevent combat abilities going off on armor stands

This commit is contained in:
nossr50
2024-03-14 13:24:57 -07:00
parent 7da8c8c83a
commit b6697141f7
5 changed files with 16 additions and 1 deletions

View File

@ -177,6 +177,10 @@ public class ExperienceConfig extends BukkitConfig {
return config.getBoolean("ExploitFix.PreventPluginNPCInteraction", true);
}
public boolean isArmorStandInteractionPrevented() {
return config.getBoolean("ExploitFix.PreventArmorStandInteraction", true);
}
public boolean isFishingExploitingPrevented() {
return config.getBoolean("ExploitFix.Fishing", true);
}

View File

@ -300,6 +300,10 @@ public final class CombatUtils {
Entity painSource = event.getDamager();
EntityType entityType = painSource.getType();
if (target instanceof ArmorStand) {
return;
}
if (target instanceof Player player) {
if(ExperienceConfig.getInstance().isNPCInteractionPrevented()) {
if (Misc.isNPCEntityExcludingVillagers(target)) {

View File

@ -39,6 +39,7 @@ ExploitFix:
TreeFellerReducedXP: true
PistonCheating: true
SnowGolemExcavation: true
PreventArmorStandInteraction: true
# This include NPCs from stuff like Citizens, this is not a setting for Vanilla Minecraft Villagers (Which can be considered NPCs)
# mcMMO normally doesn't process attacks against an Entity if it is an NPC from another plugin
# Of course, mcMMO doesn't know for sure whether something is an NPC, it checks a few known things, see our source code to see how