The item of craft item event outputs has randomized index
CraftItemEvent->getOutputs()[0] returns the crafted item isntanceCraftItemEvent->getOutputs()[0] in an event handler functionCraftLock v1.0.0, DEVirion v1.2.7, DevTools v1.14.2, LevelSystem v1.0.0, MultiWorld v1.5.1, PureChat v1.4.11, PurePerms v1.4.3, Specter v0.9, WebGetPM v0.0.1-lite
CraftItemEvent->getOutputs()[0]Var dump result of the code above:
array(1) {
[2]=>
object(pocketmine\item\Stick)#15782 (5) {
["id":protected]=>
int(280)
["meta":protected]=>
int(0)
["nbt":"pocketmine\item\Item":private]=>
object(pocketmine\nbt\tag\CompoundTag)#15508 (3) {
["value":"pocketmine\nbt\tag\CompoundTag":private]=>
array(0) {
}
["__name":protected]=>
string(0) ""
["cloning":protected]=>
bool(false)
}
["count"]=>
int(4)
["name":protected]=>
string(5) "Stick"
}
}
why u don't use array_shift() or array_pop()?
why don't you walk instead of taking a bus?
I can address this for the simple case, but the list still won't be ordered if there are multiple outputs (e.g. cake + buckets).
Most helpful comment
why don't you walk instead of taking a bus?