holder = $holder; parent::__construct(27); } protected function getOpenSound() : Sound{ return new ShulkerBoxOpenSound(); } protected function getCloseSound() : Sound{ return new ShulkerBoxCloseSound(); } public function canAddItem(Item $item) : bool{ $blockTypeId = ItemTypeIds::toBlockTypeId($item->getTypeId()); if($blockTypeId === BlockTypeIds::SHULKER_BOX || $blockTypeId === BlockTypeIds::DYED_SHULKER_BOX){ return false; } return parent::canAddItem($item); } protected function animateBlock(bool $isOpen) : void{ $holder = $this->getHolder(); //event ID is always 1 for a chest $holder->getWorld()->broadcastPacketOnBlock($holder, BlockEventPacket::create(new ProtocolBlockPosition($holder->x, $holder->y, $holder->z), 1, $isOpen ? 1 : 0)); } }