Skip to content

The coded "3rd person mode" fails to switch back randomly with one of two errors #4

@xboxone08

Description

@xboxone08

Pressing f5 switches back and forth between normal and the coded "3rd person mode". This sometimes errors 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'

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: ''

as mentioned in the issue on the mcpi repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcantfixNot sure how to fix/fix is not possibleexternal bugThe issue is due to a dependency's bughelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions