You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using keyboard for shortcuts. I have mapped the release of the key f5 to toggle the camera between setFollow(getPlayerEntityIds()[0]) and setNormal(getPlayerEntityIds()[0]). I also have a game loop processing block hits. It works fine a few times before either erroring out with:
Drained Data: <b''>
Last Message: <events.block.hits()>
Traceback (most recent call last):
File "foo_bar.py", line <irrelevant>, in <module>
events = game.events.pollBlockHits()
File "/usr/lib/python3/dist-packages/mcpi/minecraft.py", line 172, in pollBlockHits
return [BlockEvent.Hit(*list(map(int, e.split(",")))) for e in events]
File "/usr/lib/python3/dist-packages/mcpi/minecraft.py", line 172, in <listcomp>
return [BlockEvent.Hit(*list(map(int, e.split(",")))) for e in events]
TypeError: Hit() missing 4 required positional arguments: 'y', 'z', 'face', and 'entityId'
I didn't right-click during the test
or
Drained Data: <b'525'>
Last Message: <world.getPlayerIds()>
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self.kwargs)
File "/usr/local/lib/python3.7/dist-packages/keyboard/_generic.py", line 58, in process
if self.pre_process_event(event)
File "/usr/local/lib/python3.7/dist-packages/keyboard/__init__.py", line 213, in pre_process_event
key_hook(event)
File "/usr/local/lib/python3.7/dist-packages/keyboard/__init__.py", line 516, in <lambda>
return hook_key(key, lambda e: e.event_type == KEY_DOWN or callback(e), suppress=suppress)
File "foo_bar.py", line <earlier_irrelevant>, in toggle_view
game.camera.setFollow(game.getPlayerEntityIds()[0])
File "usr/lib/python3/dist-packages/mcpi/minecraft.py", line 351, in getPlayerEntityIds
return list(map(int, ids.split("|")))
ValueError: invalid literal for int() with base 10: ''
This one might be fixed with #24
Note that game is the return value of mcpi.minecraft.Minecraft.create()
I did type that by hand at 1:00 AM, so a response would be appreciated.
The text was updated successfully, but these errors were encountered:
xboxone08
changed the title
Using keyboard is created unexpected errors inside the internal code of mcpi.
Using keyboard is creating unexpected errors inside the internal code of mcpi.
Jul 5, 2022
xboxone08
changed the title
Using keyboard is creating unexpected errors inside the internal code of mcpi.
Using keyboard is creating unexpected errors inside the internal code of mcpi.
Jul 5, 2022
I am using keyboard for shortcuts. I have mapped the release of the key f5 to toggle the camera between
setFollow(getPlayerEntityIds()[0])
andsetNormal(getPlayerEntityIds()[0])
. I also have a game loop processing block hits. It works fine a few times before either erroring out with:I didn't right-click during the test
or
This one might be fixed with #24
Note that game is the return value of mcpi.minecraft.Minecraft.create()
I did type that by hand at 1:00 AM, so a response would be appreciated.
The text was updated successfully, but these errors were encountered: