use pocketmine\item\Item; $item = Item::get(1); // get a new stone block if ($item->hasCustomBlockData()) { echo "This block has custom block data."; } else { echo "This block does not have any custom block data."; }
use pocketmine\item\Item; $item = Item::get(1); // get a new stone block $isCustom = $item->hasCustomBlockData(); if ($isCustom) { echo "This item belongs to a package library that supports custom block data."; } else { echo "This item belongs to a package library that does not support custom block data."; }In this example, we first create a new stone block item using the Item::get method. We then call the hasCustomBlockData method to check if this item has any custom block data associated with it. Depending on the result, we can determine if this item belongs to a package library that supports custom block data or not. If the item has custom block data, it will output a message saying "This item belongs to a package library that supports custom block data." Otherwise, it will output "This item belongs to a package library that does not support custom block data."