diff --git a/src/endstone_test/tests/on_player_join/test_block.py b/src/endstone_test/tests/on_player_join/test_block.py new file mode 100644 index 0000000..4cf4313 --- /dev/null +++ b/src/endstone_test/tests/on_player_join/test_block.py @@ -0,0 +1,23 @@ +from babel import Locale +from endstone import Player, Server, GameMode +from endstone.plugin import Plugin +import pytest + + +@pytest.fixture +def server(player: Player) -> Server: + return player.server + + +def test_get_block_at_xyz(player: Player) -> None: + location = player.location + block = player.dimension.get_block_at(location.block_x, -64, location.block_z) + assert block.type == "minecraft:bedrock" + block = player.dimension.get_block_at(location.block_x, 320, location.block_z) + assert block.type == "minecraft:air" + + +def test_get_block_at_location(player: Player) -> None: + location = player.location + block = player.dimension.get_block_at(location) + assert block.data.type == block.type