Jump to content

ElkMan3

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by ElkMan3

  1. Hello, i am working on a mob that can have different 'personalities'. with each personality, the ai will be slightly different shy would run from the player aggressive would attack etc I set this personality as a synced value, on entity spawn. the problem Is, that the personality is set after the ai is. so is there a way to set the ai goals after the entity has been created?
  2. 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); }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.