Skip to content

Commit

Permalink
Zero fall distance and null velocity in root target.
Browse files Browse the repository at this point in the history
In an attempt to fix a potential "instant death" from fall damage when a
boss uses the root target ability, this commit makes the ability set the
player's fall distance to zero and their velocity to the null vector.
  • Loading branch information
garbagemule committed May 7, 2023
1 parent 41da54c commit 8eea082
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.Vector;

@AbilityInfo(
name = "Root Target",
Expand All @@ -33,6 +34,8 @@ public void execute(Arena arena, MABoss boss) {
return;

Player player = (Player) target;
player.setFallDistance(0);
player.setVelocity(new Vector(0, 0, 0));
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, DURATION, AMPLIFIER));
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, DURATION, AMPLIFIER));
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, DURATION, -AMPLIFIER));
Expand Down

0 comments on commit 8eea082

Please sign in to comment.