python mcpi getPlayerEntityId(name) don't work
Armyanin opened this issue · 4 comments
[00:00:23] [Server thread/INFO]: Welcome Nekto
[00:00:23] [Server thread/INFO]: Nekto[/91.77.Y.X:51363] logged in with entity id 534 at ([world]-126.46461702407282, 130.0, 16.1576389015178)
[00:00:23] [Craft Scheduler Thread - 5/INFO]: [AuthMe] Nekto logged in!
[00:00:35] [Thread-17/INFO]: [RaspberryJuice] Starting input thread
[00:00:35] [Thread-18/INFO]: [RaspberryJuice] Starting output thread!
[00:00:35] [Thread-14/INFO]: [RaspberryJuice] Opened connection to/35.231.124.218:59134.
[00:00:51] [Thread-19/INFO]: [RaspberryJuice] Starting input thread
[00:00:51] [Thread-14/INFO]: [RaspberryJuice] Opened connection to/35.231.124.218:59194.
[00:00:51] [Thread-20/INFO]: [RaspberryJuice] Starting output thread!
[00:00:51] [Server thread/INFO]: [RaspberryJuice] Closed connection to/35.231.124.218:59134.
[00:01:10] [Server thread/INFO]: [RaspberryJuice] Player [Nekto] not found.
[00:12:15] [Server thread/INFO]: [MoneyHunters] Auto-save: Saved 1 online users | 0 offline users.
[00:27:15] [Server thread/INFO]: [MoneyHunters] Auto-save: Saved 1 online users | 0 offline users.
[00:31:27] [Server thread/WARN]: [RaspberryJuice] camera.setPos is not supported.
[00:32:19] [Server thread/WARN]: [RaspberryJuice] camera.setPos is not supported.
[00:32:52] [Server thread/WARN]: [RaspberryJuice] camera.mode.setFollow is not supported.
[00:33:15] [Server thread/WARN]: [RaspberryJuice] camera.mode.setNormal is not supported.
[00:34:14] [Server thread/WARN]: [RaspberryJuice] camera.mode.setFixed is not supported.
[00:34:14] [Server thread/WARN]: [RaspberryJuice] camera.setPos is not supported.
[00:34:38] [Server thread/WARN]: [RaspberryJuice] camera.mode.setFixed is not supported.
[00:34:38] [Server thread/WARN]: [RaspberryJuice] camera.setPos is not supported.
[00:37:46] [Server thread/INFO]: [RaspberryJuice] Player [Netko] not found.
[00:38:24] [Server thread/INFO]: [RaspberryJuice] Player [Nekto] not found.
[00:40:54] [Server thread/INFO]: [RaspberryJuice] Player [Nekto] not found.
[00:41:38] [Server thread/INFO]: [RaspberryJuice] Player [Nekto] not found.
[00:42:02] [Server thread/INFO]: [RaspberryJuice] Player [Nekto] not found.
[00:42:15] [Server thread/INFO]: [MoneyHunters] Auto-save: Saved 1 online users | 0 offline users.
[00:52:14] [Server thread/INFO]: Nekto lost connection: Disconnected
[00:52:14] [Server thread/INFO]: - [Игрок] Nekto
Hi. Can you give a piece of code you are trying to run? Also please share server type and version.
from mcpi.minecraft import Minecraft
mc=Minecraft.create(address='myserver.com')
mc.getPlayerEntityId('Nekto')
server 1.15.2 mcpi 1.0.2
What server type are you using? Spigot, Paper, something else?
About mcpi, please use latest one which is 1.2.0, not 1.0.2 (unless you made a typo).
https://pypi.org/project/mcpi/
Try to list all currently connected users this way, maybe this help figure out why your nickname is not found:
from mcpi.minecraft import Minecraft
mc=Minecraft.create(address='myserver.com')
player_ids = mc.getPlayerEntityIds()
for player_id in player_ids:
print(f'Player id={player_id}, nick={mc.entity.getName(player_id)}')