Posted June 11, 20196 yr I want to change how an Entity is rendered based on some conditions in the world when it's spawned. I tried adding a Tag to it right before calling spawnEntity, but then, in the Entity's doRender method, the size of the tags is 0. Here's what I tried with the Tags. toSpawn.addTag(message.blockSide); // message.blockSide is a string that tells what side of a block it's being spawned on Then, in the Entity's rendering class' doRender method: Set<String> tags = entity.getTags(); System.out.println("Tags length: " + tags.size()); // Prints "Tags length: 0" What are some ways I can accomplish this?
June 11, 20196 yr Author Okay, looking over tags I can't find any explanation of how they're used. However, I did suddenly realize that I could store the information in the entity's class... except, I can't. When I try to access what I've stored it's null, which means that the instance of the Entity used in doRender and the instance used when I spawn it in the world are two different ones, even when I store it in the entity's class after it's spawned. I'm not quite sure what to do now!
June 12, 20196 yr Author 9 hours ago, diesieben07 said: If the data does not change and only needs to be sent at spawn you can implement IEntityAdditionalSpawnData on your entity instead. Awesome, that's what I need! I spent a while looking at Capabilities, but I guess that's not the solution. I'll take a look at IEntityAdditionalSpawnData! Thanks!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.