CC turtles are treated as actual players rather than fake players
ChiefArug opened this issue ยท 0 comments
Minecraft Version
1.18.2
KubeJS Version
kubejs-forge-1802.5.2-build.415
Rhino Version
rhino-forge-1802.1.10-build.155
Architectury Version
architectury-4.4.60
Forge/Fabric Version
Forge 40.1.19
Describe your issue
ComputerCraft turtles can use items on blocks, and trigger events like block.right_click. However, when a turtle does this event,player returns the actual player, not the turtle (and as such .isFake() returns false).
I suspect the getEntity method in LevelJS is to blame, as it gets the player based on the players data, not the actual player. Im pretty sure that the fake player from CC has the same player data as the player who placed it, thus leading to this.
To reproduce:
- Place a computer craft turtle down. Right click and put something in its first slot (has a light grey border).
- Have a script that listens to the block.right_click event and logs something relating to the player
- Type
lua
into the turtles interface, thenturtle.placeDown()
. This will cause the turtle to try right click the block directly below it with the selected item.
A bit of a band aid fix for this could be to add a getMinecraftPlayer method in events like block.right_click, allowing accessing the minecraft player directly.
Crash report/logs
No response