Bug Closed · Resolved

Vanilla mob overrides do not use the default variables

#10049 opened by DeathSwearM1 1 month ago

DeathSwearM1reported this bug

Vanilla mob overrides do not use the default variables if the mobs spawned naturally.

For example:

SHEEP:   Display: "<caster.var.UiName> <caster.var.ParentPName>\n&c[&d<mob.level> &elevel &c<caster.hp{round=2}>&e/&c<caster.mhp{round=2}><&heart>&c]"   Health: 20   Damage: 3   Faction: Animal   Variables:     MobType: normal     UiName: "&6CoolSheepName"     ParentPName: ""   ...   Skills:   ...   - setname{name=<caster.name>;delay=2} @self ~onDamaged   - setname{name=<caster.name>;delay=2} @self ~onTimer:10 ?incombat{}

When summoned via an egg, a mythic egg, or a command — everything works fine. But when this mob appears in the world, its nickname shows as "UNDEFINED UNDEFINED [X level Y/Z]".


DeathSwearM1commented

I'm tried use

  • skill{s=InitiateVanillaOverrideVariables;un="&6Pig";mt="normal"} @self ~onSpawn

InitiateVanillaOverrideVariables: Skills:

  • setVar{value="<skill.mt>";type=STRING;name=MobType;scope=caster}
  • setVar{value="<skill.un>";type=STRING;name=UiName;scope=caster}
  • setVar{value="";type=STRING;name=ParentPName;scope=caster}
  • delay 1
  • setname{name=<caster.name>}

but that didn't work either. However, if I change the trigger to, say, ~onDamaged, the skill works.

It's likely that ~onSpawn doesn't work for vanilla mobs that spawn naturally either. Perhaps that's the root cause of the bug.

Sign in to join the discussion.