diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/tag/CraftBlockTag.java b/paper-server/src/main/java/org/bukkit/craftbukkit/tag/CraftBlockTag.java index df180227e1..e3f746589a 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/tag/CraftBlockTag.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/tag/CraftBlockTag.java @@ -17,7 +17,14 @@ public class CraftBlockTag extends CraftTag { @Override public boolean isTagged(Material item) { - return CraftMagicNumbers.getBlock(item).builtInRegistryHolder().is(tag); + Block block = CraftMagicNumbers.getBlock(item); + + // SPIGOT-6952: A Material is not necessary a block, in this case return false + if (block == null) { + return false; + } + + return block.builtInRegistryHolder().is(tag); } @Override diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/tag/CraftItemTag.java b/paper-server/src/main/java/org/bukkit/craftbukkit/tag/CraftItemTag.java index 3a5bcbc811..24e6130f21 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/tag/CraftItemTag.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/tag/CraftItemTag.java @@ -17,7 +17,14 @@ public class CraftItemTag extends CraftTag { @Override public boolean isTagged(Material item) { - return CraftMagicNumbers.getItem(item).builtInRegistryHolder().is(tag); + Item minecraft = CraftMagicNumbers.getItem(item); + + // SPIGOT-6952: A Material is not necessary an item, in this case return false + if (minecraft == null) { + return false; + } + + return minecraft.builtInRegistryHolder().is(tag); } @Override