Closed byemypast closed 7 years ago
Which Minecraft version is this?
1.11
What happens if you save the old player ID, kill the player, and let the player respawn? Does the player come back with the same ID?
E.g.: id = mc.getPlayerId() while True: time.sleep(0.2) try: except: print("err") print(mc.entity.getTilePos(id))
It seems that the ID doesn't change when the player respawn, however the id doesn't work anymore. See this --> debug.zip
test.py for the test script debug.txt for recording the ID and its function after the respawn. After line 54(time tick 1482516792.878217), which is the time of respawn, the getTilePos doesn't work
Fixed in 0.86
Excuse me, but the problem still exists in 0.86. Run test.py and try to get died for 3 minutes, the getTilePos works sometimes but loses function the other time.
Merry Christmas! Really nice work and benefit a lot from your project. Thanks!
Merry Christmas to you, too.
I think 0.87 should work better.
try this: ` import mcpi.minecraft as minecraft import mcpi.block as block import time mc = minecraft.Minecraft.create()
while (1): time.sleep(0.2) try: entitys = mc.getPlayerEntityIds() except: print("err") for nplayer in entitys: print(mc.entity.getTilePos(nplayer))`
Once you get killed (by TNT for example) and try to respawn, at first getPlayerEntityIds() would throw an exception(show 'err' in the script above) and then the function wouldn't work. (function getTilePos would always output the same location even the player moved)