Hello when im trying to put a class in an array (for an chest refill plugin) why i couldnt put classes in my array? example: PHP: §this->chest = [new item(1, 0, 1)] ?
Yes you can. PHP: $this->chest = [new Item(1, 0, 1)]; Remember to put use pocketmine\item\Item at the front; and 0 and 1 are the default parameters in parameters 2 and 3 of Item constructor, which you can omit if they are 0 and 1. What? The only function that starts with spl_object is spl_object_hash(), and it has nothing to do with this thread.