I have a custom entity(i use MCreator to make templates, and i edit the code myself)
im making a mob that can have different personalities, and that will change the behavior.
how I'm setting the personality is through an nbt tag.
i initially set this tag on the trigger that MCreator provides, onEntitySpawn, but this would trigger after the entities goals have already been set, so I changed it so that is called before the goals have been set. The problem is, that It is not working.
Is NBT data available this early in the definition?
this is the relevant code: (the null check is so that the personality is not changed if it already has been set, and GnomeOnInitialEntitySpawnProcedure() just calls a few things, including the personality assignment )
public String getPersonality() {
return this.getPersistentData().getString("Personality");
}
@Override
protected void registerGoals() {
String personality = this.getPersonality();
if(personality == null || personality.isEmpty()) {
GnomeOnInitialEntitySpawnProcedure.execute(this);
}