Thread: Main
Error: Hebbinkpro\MagicCrates\event\CrateRewardEvent::__construct(): Argument #2 ($player) must be of type pocketmine\player\Player, null given, called in /root/plugins/MagicCrates_dev-44/src/Hebbinkpro/MagicCrates/entity/CrateItem.php on line 75
File: plugins/MagicCrates_dev-44/src/Hebbinkpro/MagicCrates/event/CrateRewardEvent
Line: 17
Type: TypeError
Backtrace:
Code:
[8]
[9] /
[10] Called when the crate reward is given to the player after the opening animation.
[11] /
[12] class CrateRewardEvent extends CrateEvent
[13] {
[14] private Player $player;
[15] private CrateReward $reward;
[16]
[17] public function construct(Crate $crate, Player $player, CrateReward $reward)
[18] {
[19] parent::construct($crate);
[20]
[21] $this->player = $player;
[22] $this->reward = $reward;
[23]
[24] }
[25]
[26] /
[27] * @return Player
when people try open crate, then i shutdown the server and i turn on again when people joining the crash showing this.
Thread: Main Error: Hebbinkpro\MagicCrates\event\CrateRewardEvent::__construct(): Argument #2 ($player) must be of type pocketmine\player\Player, null given, called in /root/plugins/MagicCrates_dev-44/src/Hebbinkpro/MagicCrates/entity/CrateItem.php on line 75 File: plugins/MagicCrates_dev-44/src/Hebbinkpro/MagicCrates/event/CrateRewardEvent Line: 17 Type: TypeError Backtrace:
0 plugins/MagicCrates_dev-44/src/Hebbinkpro/MagicCrates/entity/CrateItem(75): Hebbinkpro\MagicCrates\event\CrateRewardEvent->__construct(object Hebbinkpro\MagicCrates\crate\Crate#43145, null, object Hebbinkpro\MagicCrates\crate\CrateReward#43201)
1 pmsrc/src/entity/Entity(1009): Hebbinkpro\MagicCrates\entity\CrateItem->entityBaseTick(int 1)
2 pmsrc/src/world/World(1055): pocketmine\entity\Entity->onUpdate(int 5426)
3 pmsrc/src/world/World(978): pocketmine\world\World->actuallyDoTick(int 5426)
4 pmsrc/src/world/WorldManager(351): pocketmine\world\World->doTick(int 5426)
5 pmsrc/src/Server(1818): pocketmine\world\WorldManager->tick(int 5426)
6 pmsrc/src/Server(1700): pocketmine\Server->tick()
7 pmsrc/src/Server(1076): pocketmine\Server->tickProcessor()
8 pmsrc/src/PocketMine(334): pocketmine\Server->__construct(object pocketmine\thread\ThreadSafeClassLoader#3, object pocketmine\utils\MainLogger#6, string[6] /root/, string[14] /root/plugins/)
9 pmsrc/src/PocketMine(357): pocketmine\server()
10 pmsrc(11): require(string[50] phar:///root/PocketMine-MP.phar/src/PocketMine.php)
Code: [8] [9] / [10] Called when the crate reward is given to the player after the opening animation. [11] / [12] class CrateRewardEvent extends CrateEvent [13] { [14] private Player $player; [15] private CrateReward $reward; [16] [17] public function construct(Crate $crate, Player $player, CrateReward $reward) [18] { [19] parent::construct($crate); [20] [21] $this->player = $player; [22] $this->reward = $reward; [23] [24] } [25] [26] / [27] * @return Player
when people try open crate, then i shutdown the server and i turn on again when people joining the crash showing this.