Can anyone please explain what returns getBlockAgainst method in onBlockPlaceEvent handler? I'm understand that if I'm placing stone block instead of water block then $event->getBlock() will be Stone, $event->getBlockReplaced() will be Water, but what the meaning of $event->getBlockAgainst() ?
Just var_dump it to see what it returns PHP: var_dump($event->getBlockAgainst()) I assuime it would return the block you tapped when placing the block.
True, function will return a instance of Block which player tapped in order to place the block. Theoretically the return should be equal to PHP: PlayerInteractEvent::getBlock() and (If you are not using "Split controls") PHP: // 6 is how far player can break blocks (not sure about place, yet).Player::getTargetBlock(6, [0])