Skip to content

Commit

Permalink
Critical Dupe Fix, Shulkers graving (#4122)
Browse files Browse the repository at this point in the history
Cancellig damage event on thrown item entities and removing them manually to avoid spilling shulker box content when it is destroyed by explosions.
  • Loading branch information
PikaTheLeg authored Feb 2, 2024
1 parent 8e5d9c3 commit dfed4c9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ public void entityDamage(EntityDamageEvent event) {
// If a hoped item isn't put into a grave (because graves are disabled), cancel all non-void damage.
event.setCancelled(true);
entity.setInvulnerable(true); // also make the item invulnerable to prevent this event from being spammed
} else if (GraveManager.isThrownItem(entity)) {
// Cancel damage event, remove manually.
event.setCancelled(true);
entity.remove();
}
} else if (GraveManager.isGrave(event.getEntity())) {
event.setCancelled(true);
Expand Down

0 comments on commit dfed4c9

Please sign in to comment.