Merge pull request #213 from 0ft3n/master

Added ignore-sweep-attacks: true/false to summoning extension.
This commit is contained in:
Will FP 2022-06-14 08:21:25 +01:00 committed by GitHub
commit baeb012b72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 6 deletions

View File

@ -14,6 +14,7 @@ import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityTargetEvent;
import org.jetbrains.annotations.NotNull;
@ -41,6 +42,11 @@ public abstract class SummoningEnchantment extends EcoEnchant {
return;
}
if (event.getCause() == EntityDamageEvent.DamageCause.ENTITY_SWEEP_ATTACK
&& this.getConfig().getBool("config.ignore-sweep-attacks")) {
return;
}
doSpawn(attacker, victim, level);
}

View File

@ -29,4 +29,5 @@ config:
mobs-per-level: 2 # Amount of mobs to spawn per level
ticks-to-live-per-level: 30 # Ticks for mob to live per level
health-per-level: 6 # Health for mobs to have per level
chance-per-level: 5 # Chance to spawn mobs per level
chance-per-level: 5 # Chance to spawn mobs per level
ignore-sweep-attacks: true # Ignore sweep attacks

View File

@ -30,4 +30,5 @@ config:
ticks-to-live-per-level: 50 # Ticks for mob to live per level
health-per-level: 4 # Health for mobs to have per level
chance-per-level: 5 # Chance to spawn mobs per level
allow-not-fully-charged: false # don't require sword attack to be at full charge
allow-not-fully-charged: false # don't require sword attack to be at full charge
ignore-sweep-attacks: true # Ignore sweep attacks

View File

@ -30,4 +30,5 @@ config:
mobs-per-level: 1 # Amount of mobs to spawn per level
ticks-to-live-per-level: 30 # Ticks for mob to live per level
health-per-level: 4 # Health for mobs to have per level
chance-per-level: 5 # Chance to spawn mobs per level
chance-per-level: 5 # Chance to spawn mobs per level
ignore-sweep-attacks: true # Ignore sweep attacks

View File

@ -30,4 +30,5 @@ config:
mobs-per-level: 1 # Amount of mobs to spawn per level
ticks-to-live-per-level: 30 # Ticks for mob to live per level
health-per-level: 6 # Health for mobs to have per level
chance-per-level: 5 # Chance to spawn mobs per level
chance-per-level: 5 # Chance to spawn mobs per level
ignore-sweep-attacks: true # Ignore sweep attacks

View File

@ -29,4 +29,5 @@ config:
mobs-per-level: 2 # Amount of mobs to spawn per level
ticks-to-live-per-level: 40 # Ticks for mob to live per level
health-per-level: 4 # Health for mobs to have per level
chance-per-level: 5 # Chance to spawn mobs per level
chance-per-level: 5 # Chance to spawn mobs per level
ignore-sweep-attacks: true # Ignore sweep attacks

View File

@ -30,4 +30,5 @@ config:
ticks-to-live-per-level: 20 # Ticks for mob to live per level
health-per-level: 4 # Health for mobs to have per level
chance-per-level: 5 # Chance to spawn mobs per level
allow-not-fully-charged: false # don't require sword attack to be at full charge
allow-not-fully-charged: false # don't require sword attack to be at full charge
ignore-sweep-attacks: true # Ignore sweep attacks