Created
August 5, 2020 11:24
-
-
Save PJZ9n/2c303e2507428125313626b68af9b1d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function onPlayerChestInventoryChange(PlayerChestInventoryChangeEvent $event): void | |
{ | |
$source = $event->getSource(); | |
$target = $event->getTarget(); | |
$player = $event->getPlayerCursorInventory()->getHolder(); | |
//$player->removeWindow($event->getChestInventory()); | |
/*$form = new class implements Form { | |
public function handleResponse(Player $player, $data): void | |
{ | |
// TODO: Implement handleResponse() method. | |
} | |
public function jsonSerialize(): array | |
{ | |
return [ | |
"type" => "modal", | |
"title" => "タイトル", | |
"button1" => "12345", | |
"button2" => "67890", | |
]; | |
} | |
}; | |
$player->sendForm($form); | |
var_dump("sended!");*/ | |
/*$chest = $event->getChestInventory()->getHolder(); | |
$chestBlock = $chest->getBlock(); | |
$packet = new BlockEventPacket(); | |
$packet->x = $chestBlock->x; | |
$packet->y = $chestBlock->y; | |
$packet->z = $chestBlock->z; | |
$packet->eventType = 1; | |
$packet->eventData = 0; | |
$chestBlock->getLevel()->addChunkPacket($chestBlock->x >> 4, $chestBlock->z >> 4, $packet);*/ | |
var_dump("bbbb"); | |
var_dump($event->getEventName()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment