Started by
Mecho
on
Topic category: Help with Minecraft modding (Java Edition)
Title
I'm making an entity that is only visible to one player, by setting the texture to blank on the client side when they are not the target.
And while in testing it is most certainly possible to hide the entity by using a logic custom nbt tag, I've run into a dead end when trying to find the player entity that the client is playing as, as I need it to match the client's player to the player the entity is targeting.
Any help would be appreciated :)
Hey, not sure if this is exactly what you needed, or if you still even need it anymore, but I have found how to get the player entity associated with the client. (I wish there was just a procedure block for checking if the player entity is, but oh well.)
I just did this test, so I can't be 100% sure it works, but I'm very confident it does. I figured out that your game client always loads your player entity first. So when your client-sided instance of "On player tick update" goes through all players that are on the server, yours will be first. Now, because your player always gets executed first, we can abuse this with the following procedure:
Hey so I definitely 100% overcomplicated this. The method I described barely even works. So here's a new one:
You can just make a global string variable with the type "global session" and then create a custom dummy overlay to use the display condition procedure to set the global session string to "get uuid of event/target entity" which will always be you because it's an overlay. Later in any procedure, you can check if get UUID of event/target entity = VARIABLE
Been a while, but I at least hope this helps anyone else finding it.