-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Labels
status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.Disputed bug is accepted as valid or Feature accepted as desired to be added.version: 1.21.4Game version 1.21.4Game version 1.21.4
Description
Expected behavior
entity that die next to Sculk Catalyst will not generate exp
Observed/Actual behavior
exp still generate
Steps/models to reproduce
- place Sculk Catalyst
- kill a entity
- look exp spawn
Plugin and Datapack List
None
Paper version
Other
Link LeavesMC/Leaves#452
The problem lies in the outdated API support
org.bukkit.event.entity.EntityDeathEvent deathEvent = this.dropAllDeathLoot(serverLevel, damageSource);
if (deathEvent == null || !deathEvent.isCancelled()) {
//if (entityliving != null) { // Paper - Fix item duplication and teleport issues; moved to be run earlier in #dropAllDeathLoot before destroying the drop items in CraftEventFactory#callEntityDeathEvent
// entityliving.awardKillScore(this, damageSource);
//}
// Paper start - clear equipment if event is not cancelled
if (this instanceof Mob) {
for (EquipmentSlot slot : this.clearedEquipmentSlots) {
this.setItemSlot(slot, ItemStack.EMPTY);
}
this.clearedEquipmentSlots.clear();
}
// Paper end
if (this.isSleeping()) {
this.stopSleeping();
}
if (!this.level().isClientSide && this.hasCustomName()) {
if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot
}
this.getCombatTracker().recheckStatus();
if (entity != null) {
entity.killedEntity((ServerLevel) this.level(), this);
}
this.gameEvent(GameEvent.ENTITY_DIE);
}
dropAllDeathLoot
generate experience before triggering gameEvent.
I have created a PR to solve it, but this may break the original API behavior, for reference only
Metadata
Metadata
Assignees
Labels
status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.Disputed bug is accepted as valid or Feature accepted as desired to be added.version: 1.21.4Game version 1.21.4Game version 1.21.4