2019-07-28 14:32:14 +00:00
From 5cf90690617048b1f94b303f4af011d0add5188f Mon Sep 17 00:00:00 2001
2018-09-08 00:14:48 +00:00
From: Phoenix616 <mail@moep.tv>
Date: Tue, 21 Aug 2018 01:39:35 +0100
Subject: [PATCH] Improve death events
This adds the ability to cancel the death events and to modify the sound
an entity makes when dying. (In cases were no sound should it will be
called with shouldPlaySound set to false allowing unsilencing of silent
entities)
It makes handling of entity deaths a lot nicer as you no longer need
to listen on the damage event and calculate if the entity dies yourself
to cancel the death which has the benefit of also receiving the dropped
items and experience which is otherwise only properly possible by using
internal code.
diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java
2019-07-23 19:17:32 +00:00
index 84c3ea9d0..f563a7b63 100644
2018-09-08 00:14:48 +00:00
--- a/src/main/java/net/minecraft/server/CombatTracker.java
+++ b/src/main/java/net/minecraft/server/CombatTracker.java
2019-01-01 03:15:55 +00:00
@@ -175,6 +175,7 @@ public class CombatTracker {
2018-09-08 00:14:48 +00:00
this.h = null;
}
+ public void reset() { this.g(); } // Paper - OBFHELPER
public void g() {
int i = this.f ? 300 : 100;
2019-01-01 03:15:55 +00:00
2018-09-08 00:14:48 +00:00
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
2019-07-23 19:17:32 +00:00
index 7811beb80..f9b097fd6 100644
2018-09-08 00:14:48 +00:00
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
2019-07-16 22:09:32 +00:00
@@ -1517,6 +1517,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
2018-09-08 00:14:48 +00:00
return false;
}
+ public void runKillTrigger(Entity entity, int kills, DamageSource damageSource) { this.a(entity, kills, damageSource); } // Paper - OBFHELPER
public void a(Entity entity, int i, DamageSource damagesource) {
if (entity instanceof EntityPlayer) {
CriterionTriggers.c.a((EntityPlayer) entity, this, damagesource);
2019-07-16 22:09:32 +00:00
@@ -2410,6 +2411,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
2018-09-08 23:12:58 +00:00
this.fallDistance = 0.0F;
2018-09-08 00:14:48 +00:00
}
+ public void onKill(EntityLiving entityLiving) { this.b(entityLiving); } // Paper - OBFHELPER
public void b(EntityLiving entityliving) {}
2019-05-05 11:12:32 +00:00
protected void i(double d0, double d1, double d2) {
2018-09-08 00:14:48 +00:00
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
2019-07-23 19:17:32 +00:00
index 627925e3b..e516db270 100644
2018-09-08 00:14:48 +00:00
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
2019-07-23 19:17:32 +00:00
@@ -683,7 +683,8 @@ public class EntityArmorStand extends EntityLiving {
2018-09-08 00:14:48 +00:00
2019-05-05 11:12:32 +00:00
@Override
2018-09-08 00:14:48 +00:00
public void killEntity() {
- org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, drops); // CraftBukkit - call event
+ org.bukkit.event.entity.EntityDeathEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, drops); // CraftBukkit - call event // Paper - make cancellable
+ if (event.isCancelled()) return; // Paper - make cancellable
this.die();
}
2019-05-06 07:20:16 +00:00
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
2019-07-23 19:17:32 +00:00
index 85231309f..1da2f013f 100644
2019-05-06 07:20:16 +00:00
--- a/src/main/java/net/minecraft/server/EntityFox.java
+++ b/src/main/java/net/minecraft/server/EntityFox.java
2019-05-07 12:00:51 +00:00
@@ -597,15 +597,25 @@ public class EntityFox extends EntityAnimal {
2019-05-06 07:20:16 +00:00
}
@Override
- protected void d(DamageSource damagesource) {
2019-05-07 15:20:32 +00:00
- ItemStack itemstack = this.getEquipment(EnumItemSlot.MAINHAND);
2019-05-06 07:20:16 +00:00
+ protected org.bukkit.event.entity.EntityDeathEvent d(DamageSource damagesource) { // Paper
2019-05-07 15:20:32 +00:00
+ ItemStack itemstack = this.getEquipment(EnumItemSlot.MAINHAND).cloneItemStack(); // Paper
+
2019-05-07 12:00:51 +00:00
+ // Paper start - Cancellable death event
+ org.bukkit.event.entity.EntityDeathEvent deathEvent = super.d(damagesource);
+
+ // Below is code to drop
+
+ if (deathEvent == null || deathEvent.isCancelled()) {
+ return deathEvent;
+ }
+ // Paper end
2019-05-07 15:20:32 +00:00
2019-05-06 07:20:16 +00:00
if (!itemstack.isEmpty()) {
2019-05-07 12:00:51 +00:00
this.a(itemstack);
2019-05-06 07:20:16 +00:00
this.setSlot(EnumItemSlot.MAINHAND, ItemStack.a);
}
- super.d(damagesource);
2019-05-07 12:00:51 +00:00
+ return deathEvent; // Paper
2019-05-06 07:20:16 +00:00
}
public static boolean a(EntityFox entityfox, EntityLiving entityliving) {
2018-09-08 00:14:48 +00:00
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
2019-07-23 19:17:32 +00:00
index edc25586a..37ff76486 100644
2018-09-08 00:14:48 +00:00
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
2019-05-05 11:12:32 +00:00
@@ -85,7 +85,7 @@ public abstract class EntityLiving extends Entity {
protected float aV;
protected float aW;
protected float aX;
- protected int aY;
+ protected int aY; protected int getKillCount() { return this.aY; } // Paper - OBFHELPER
2018-09-08 00:14:48 +00:00
public float lastDamage;
2019-05-05 11:12:32 +00:00
protected boolean jumping;
public float bb;
@@ -128,6 +128,7 @@ public abstract class EntityLiving extends Entity {
2018-09-08 00:14:48 +00:00
public boolean collides = true;
public boolean canPickUpLoot;
2018-09-08 23:12:58 +00:00
public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper
2018-09-08 00:14:48 +00:00
+ public boolean silentDeath = false; // Paper - mark entity as dying silently for cancellable death event
@Override
public float getBukkitYaw() {
2019-05-27 23:01:45 +00:00
@@ -1185,13 +1186,17 @@ public abstract class EntityLiving extends Entity {
2018-09-08 23:12:58 +00:00
if (this.getHealth() <= 0.0F) {
2019-05-05 11:12:32 +00:00
if (!this.f(damagesource)) {
- SoundEffect soundeffect = this.getSoundDeath();
2018-09-08 23:12:58 +00:00
+ // Paper start - moved into CraftEventFactory event caller for cancellable death event
2019-05-05 11:12:32 +00:00
+ //SoundEffect soundeffect = this.getSoundDeath();
2018-09-08 23:12:58 +00:00
- if (flag1 && soundeffect != null) {
2019-06-25 01:47:58 +00:00
- this.a(soundeffect, this.getSoundVolume(), this.cV());
2018-09-08 23:12:58 +00:00
- }
+ //if (flag1 && soundeffect != null) {
2019-06-25 01:47:58 +00:00
+ // this.a(soundeffect, this.getSoundVolume(), this.cV());
2018-09-08 23:12:58 +00:00
+ //}
+ this.silentDeath = !flag1; // mark entity as dying silently
+ // Paper end
this.die(damagesource);
+ this.silentDeath = false; // Paper - cancellable death event - reset to default
}
} else if (flag1) {
this.c(damagesource);
2019-06-25 01:47:58 +00:00
@@ -1329,6 +1334,7 @@ public abstract class EntityLiving extends Entity {
2018-09-08 00:14:48 +00:00
Entity entity = damagesource.getEntity();
2019-05-05 11:12:32 +00:00
EntityLiving entityliving = this.getKillingEntity();
2018-09-08 00:14:48 +00:00
2019-06-25 01:47:58 +00:00
+ /* // Paper - move down to make death event cancellable
if (this.aY >= 0 && entityliving != null) {
entityliving.a(this, this.aY, damagesource);
}
@@ -1340,11 +1346,29 @@ public abstract class EntityLiving extends Entity {
if (this.isSleeping()) {
2019-07-20 04:01:24 +00:00
this.dy();
2019-06-25 01:47:58 +00:00
}
+ */ // Paper
2018-12-17 05:18:06 +00:00
this.killed = true;
2018-09-08 00:14:48 +00:00
- this.getCombatTracker().g();
+ //this.getCombatTracker().g();
if (!this.world.isClientSide) {
2019-05-05 11:12:32 +00:00
- this.d(damagesource);
+ org.bukkit.event.entity.EntityDeathEvent deathEvent = this.d(damagesource);
2019-05-07 12:00:51 +00:00
+ if (deathEvent == null || !deathEvent.isCancelled()) {
2019-05-05 11:12:32 +00:00
+ if (this.getKillCount() >= 0 && entityliving != null) {
+ entityliving.runKillTrigger(this, this.getKillCount(), damagesource);
+ }
+ if (entity != null) {
+ entity.onKill(this);
+ }
+ if (this.isSleeping()) {
2019-07-20 04:01:24 +00:00
+ this.dy();
2019-05-05 11:12:32 +00:00
+ }
+ this.getCombatTracker().reset();
+ } else {
+ this.killed = false;
+ this.setHealth((float) deathEvent.getReviveHealth());
2018-09-08 00:14:48 +00:00
+ }
2019-05-05 11:12:32 +00:00
+ // Paper end
2018-09-08 00:14:48 +00:00
+
2019-05-05 11:12:32 +00:00
boolean flag = false;
if (entityliving instanceof EntityWither) {
2019-06-25 01:47:58 +00:00
@@ -1371,7 +1395,8 @@ public abstract class EntityLiving extends Entity {
2018-09-08 00:14:48 +00:00
}
}
2019-05-05 11:12:32 +00:00
- protected void d(DamageSource damagesource) {
2019-06-25 01:47:58 +00:00
+ protected org.bukkit.event.entity.EntityDeathEvent processDeath(DamageSource damagesource) { return d(damagesource); } // Paper - OBFHELPER
2019-05-05 11:12:32 +00:00
+ protected org.bukkit.event.entity.EntityDeathEvent d(DamageSource damagesource) { // Paper
Entity entity = damagesource.getEntity();
int i;
2018-09-08 00:14:48 +00:00
2019-06-25 01:47:58 +00:00
@@ -1383,18 +1408,20 @@ public abstract class EntityLiving extends Entity {
2019-05-05 11:12:32 +00:00
boolean flag = this.lastDamageByPlayerTime > 0;
2019-06-25 01:47:58 +00:00
2019-05-05 11:12:32 +00:00
+ org.bukkit.event.entity.EntityDeathEvent deathEvent = null; // Paper
2019-06-25 01:47:58 +00:00
if (this.isDropExperience() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
2019-05-05 11:12:32 +00:00
this.a(damagesource, flag);
this.dropDeathLoot(damagesource, i, flag);
// CraftBukkit start - Call death event
- CraftEventFactory.callEntityDeathEvent(this, this.drops);
- this.drops = new ArrayList<org.bukkit.inventory.ItemStack>();
+ deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops); // Paper
+ if (!deathEvent.isCancelled()) this.drops = new ArrayList<org.bukkit.inventory.ItemStack>(); // Paper
} else {
- CraftEventFactory.callEntityDeathEvent(this);
+ deathEvent = CraftEventFactory.callEntityDeathEvent(this); // Paper
// CraftBukkit end
}
2018-09-08 00:14:48 +00:00
2019-06-25 01:47:58 +00:00
- this.cF();
+ if (!deathEvent.isCancelled()) this.cF();; // Paper
2019-05-05 11:12:32 +00:00
+ return deathEvent; // Paper
2018-09-08 00:14:48 +00:00
}
2019-06-25 01:47:58 +00:00
protected void cF() {}
@@ -1448,6 +1475,7 @@ public abstract class EntityLiving extends Entity {
2019-05-05 23:24:37 +00:00
return SoundEffects.ENTITY_GENERIC_HURT;
}
+ public final SoundEffect getDeathSoundEffect() { return this.getSoundDeath(); } // Paper - OBFHELPER
@Nullable
protected SoundEffect getSoundDeath() {
return SoundEffects.ENTITY_GENERIC_DEATH;
2019-06-25 01:47:58 +00:00
@@ -1897,10 +1925,12 @@ public abstract class EntityLiving extends Entity {
2019-05-05 23:24:37 +00:00
}
+ public final float getDeathSoundVolume() { return this.getSoundVolume(); } // Paper - OBFHELPER
protected float getSoundVolume() {
2018-09-08 00:14:48 +00:00
return 1.0F;
}
2019-06-25 01:47:58 +00:00
+ public float getSoundPitch() { return cV();} // Paper - OBFHELPER
protected float cV() {
2018-09-08 00:14:48 +00:00
return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
2019-07-23 19:17:32 +00:00
index dcd48d8b3..d7bc6e329 100644
2018-09-08 00:14:48 +00:00
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
2019-05-06 02:58:04 +00:00
@@ -75,6 +75,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
2018-09-09 18:38:27 +00:00
public int ping;
public boolean viewingCredits;
2018-09-08 00:14:48 +00:00
private int containerUpdateDelay; // Paper
+ // Paper start - cancellable death event
+ public boolean queueHealthUpdatePacket = false;
+ public net.minecraft.server.PacketPlayOutUpdateHealth queuedHealthUpdatePacket;
+ // Paper end
// CraftBukkit start
public String displayName;
2019-07-23 19:17:32 +00:00
@@ -533,6 +537,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
2018-09-08 00:14:48 +00:00
2018-09-08 23:12:58 +00:00
String deathmessage = defaultMessage.getString();
2018-09-08 00:14:48 +00:00
org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage, keepInventory);
+ // Paper start - cancellable death event
+ if (event.isCancelled()) {
+ // make compatible with plugins that might have already set the health in an event listener
+ if (this.getHealth() <= 0) {
+ this.setHealth((float) event.getReviveHealth());
+ }
+ return;
+ }
+ // Paper end
2019-01-01 03:15:55 +00:00
// SPIGOT-943 - only call if they have an inventory open
if (this.activeContainer != this.defaultContainer) {
2019-07-23 19:17:32 +00:00
@@ -686,8 +699,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
2018-09-08 00:14:48 +00:00
}
}
}
-
- return super.damageEntity(damagesource, f);
+ // Paper start - cancellable death events
+ //return super.damageEntity(damagesource, f);
+ this.queueHealthUpdatePacket = true;
+ boolean damaged = super.damageEntity(damagesource, f);
+ this.queueHealthUpdatePacket = false;
+ if (this.queuedHealthUpdatePacket != null) {
+ this.playerConnection.sendPacket(this.queuedHealthUpdatePacket);
+ this.queuedHealthUpdatePacket = null;
+ }
+ return damaged;
+ // Paper end
}
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
2019-07-23 19:17:32 +00:00
index 73cb64e09..9f317ff2e 100644
2018-09-08 00:14:48 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
2019-05-05 11:12:32 +00:00
@@ -806,6 +806,22 @@ public enum CraftSound {
2018-09-08 00:14:48 +00:00
WEATHER_RAIN_ABOVE("weather.rain.above");
private final String minecraftKey;
+ // Paper start - cancellable death event
+ public static CraftSound getBySoundEffect(final SoundEffect effect) {
2018-09-08 23:12:58 +00:00
+ MinecraftKey key = IRegistry.SOUND_EVENT.getKey(effect);
2018-09-08 00:14:48 +00:00
+ Preconditions.checkArgument(key != null, "Key for sound effect %s not found?", effect.toString());
+
+ return valueOf(key.getKey().replace('.', '_').toUpperCase(java.util.Locale.ENGLISH));
+ }
+
+ public static Sound getSoundByEffect(final SoundEffect effect) {
+ return Sound.valueOf(getBySoundEffect(effect).name());
+ }
+
+ public static SoundEffect getSoundEffect(final Sound sound) {
+ return getSoundEffect(getSound(sound));
+ }
+ // Paper end
CraftSound(String minecraftKey) {
this.minecraftKey = minecraftKey;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
2019-07-23 19:17:32 +00:00
index 2c99a1e9d..e9458dc65 100644
2018-09-08 00:14:48 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
2019-06-25 01:47:58 +00:00
@@ -1722,7 +1722,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
2018-09-08 00:14:48 +00:00
}
public void sendHealthUpdate() {
- getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateHealth(getScaledHealth(), getHandle().getFoodData().getFoodLevel(), getHandle().getFoodData().getSaturationLevel()));
+ // Paper start - cancellable death event
+ //getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateHealth(getScaledHealth(), getHandle().getFoodData().getFoodLevel(), getHandle().getFoodData().getSaturationLevel()));
+ PacketPlayOutUpdateHealth packet = new PacketPlayOutUpdateHealth(getScaledHealth(), getHandle().getFoodData().getFoodLevel(), getHandle().getFoodData().getSaturationLevel());
+ if (this.getHandle().queueHealthUpdatePacket) {
+ this.getHandle().queuedHealthUpdatePacket = packet;
+ } else {
+ this.getHandle().playerConnection.sendPacket(packet);
+ }
+ // Paper end
}
public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
2019-07-28 14:32:14 +00:00
index 5309a4e30..4074100c4 100644
2018-09-08 00:14:48 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
2019-05-27 10:57:28 +00:00
@@ -736,9 +736,16 @@ public class CraftEventFactory {
2018-09-08 00:14:48 +00:00
public static EntityDeathEvent callEntityDeathEvent(EntityLiving victim, List<org.bukkit.inventory.ItemStack> drops) {
CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity();
EntityDeathEvent event = new EntityDeathEvent(entity, drops, victim.getExpReward());
+ populateFields(victim, event); // Paper - make cancellable
CraftWorld world = (CraftWorld) entity.getWorld();
Bukkit.getServer().getPluginManager().callEvent(event);
+ // Paper start - make cancellable
+ if (event.isCancelled()) {
+ return event;
+ }
+ playDeathSound(victim, event);
+ // Paper end
victim.expToDrop = event.getDroppedExp();
for (org.bukkit.inventory.ItemStack stack : event.getDrops()) {
2019-05-27 10:57:28 +00:00
@@ -754,8 +761,15 @@ public class CraftEventFactory {
2018-09-08 00:14:48 +00:00
CraftPlayer entity = victim.getBukkitEntity();
PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage);
event.setKeepInventory(keepInventory);
+ populateFields(victim, event); // Paper - make cancellable
org.bukkit.World world = entity.getWorld();
Bukkit.getServer().getPluginManager().callEvent(event);
+ // Paper start - make cancellable
+ if (event.isCancelled()) {
+ return event;
+ }
+ playDeathSound(victim, event);
+ // Paper end
victim.keepLevel = event.getKeepLevel();
victim.newLevel = event.getNewLevel();
2019-07-28 14:32:14 +00:00
@@ -772,6 +786,31 @@ public class CraftEventFactory {
2018-09-08 00:14:48 +00:00
return event;
}
+ // Paper start - helper methods for making death event cancellable
+ // Add information to death event
+ private static void populateFields(EntityLiving victim, EntityDeathEvent event) {
+ event.setReviveHealth(event.getEntity().getAttribute(org.bukkit.attribute.Attribute.GENERIC_MAX_HEALTH).getValue());
+ event.setShouldPlayDeathSound(!victim.silentDeath && !victim.isSilent());
2019-05-05 23:24:37 +00:00
+ net.minecraft.server.SoundEffect soundEffect = victim.getDeathSoundEffect();
2018-09-08 00:14:48 +00:00
+ event.setDeathSound(soundEffect != null ? org.bukkit.craftbukkit.CraftSound.getSoundByEffect(soundEffect) : null);
2019-05-05 23:24:37 +00:00
+ event.setDeathSoundCategory(org.bukkit.SoundCategory.valueOf(victim.getSoundCategory().name()));
2018-09-08 00:14:48 +00:00
+ event.setDeathSoundVolume(victim.getDeathSoundVolume());
2019-05-05 23:24:37 +00:00
+ event.setDeathSoundPitch(victim.getSoundPitch());
2018-09-08 00:14:48 +00:00
+ }
+
+ // Play death sound manually
+ private static void playDeathSound(EntityLiving victim, EntityDeathEvent event) {
+ if (event.shouldPlayDeathSound() && event.getDeathSound() != null && event.getDeathSoundCategory() != null) {
+ EntityHuman source = victim instanceof EntityHuman ? (EntityHuman) victim : null;
+ double x = event.getEntity().getLocation().getX();
+ double y = event.getEntity().getLocation().getY();
+ double z = event.getEntity().getLocation().getZ();
2019-05-05 23:24:37 +00:00
+ net.minecraft.server.SoundEffect soundEffect = org.bukkit.craftbukkit.CraftSound.getSoundEffect(event.getDeathSound());
+ net.minecraft.server.SoundCategory soundCategory = net.minecraft.server.SoundCategory.valueOf(event.getDeathSoundCategory().name());
2018-09-08 00:14:48 +00:00
+ victim.world.sendSoundEffect(source, x, y, z, soundEffect, soundCategory, event.getDeathSoundVolume(), event.getDeathSoundPitch());
+ }
+ }
+ // Paper end
/**
* Server methods
*/
--
2019-06-16 10:15:21 +00:00
2.22.0
2018-09-08 00:14:48 +00:00