From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Luna Date: Sun, 13 Mar 2022 14:38:38 -0300 Subject: [PATCH] ItemEntity - Check if items are air before calling setItem diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java index 76e010769786132d8af3889051b3f52e9f683509..c8ac6e7dd19dfe38a99364f586c8d8d5e2539fb4 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java @@ -424,11 +424,15 @@ public class ItemEntity extends Entity implements TraceableEntity { CompoundTag nbttagcompound1 = nbt.getCompound("Item"); - this.setItem(ItemStack.of(nbttagcompound1)); - if (this.getItem().isEmpty()) { + // Scissors start + ItemStack item = ItemStack.of(nbttagcompound1); + if (item.isEmpty()) { this.discard(); + return; } + this.setItem(item); + // Scissors end } @Override