Provide trigger beforeSpawn
Summary
Currently we can use the trigger onSpawn to execute skills when a mob spawns. But the trigger onSpawn is fired when the model is already painted.
In case you want to check for spawn conditions and conditionally remove the mob, some flickering will occur. F. e. this mechanic is described here: https://www.mythicmobs.net/manual/doku.php/tutorials/vanillaoverrides
It would be nice to have a trigger "beforeSpawn" to fix the flickering.
Usage
My use case is to check for the lightlevel where hostile mobs will spawn and conditionally remove the mobs for lightlevel 2 to 7 (I hate all those torches about everywhere).
My config:
MythicMobs/Mobs/VanillaMobs.yml
(Note: I also reduced the total amount of SKELETON and CREEPER by 30%)
SKELETON:
Skills:
- remove @self ~onSpawn 0.3
- skill{s=LowerLightLevel} ~onSpawn
CREEPER:
Skills:
- remove @self ~onSpawn 0.3
- skill{s=LowerLightLevel} ~onSpawn
SPIDER:
Skills:
- skill{s=LowerLightLevel} ~onSpawn
ZOMBIE:
Skills:
- skill{s=LowerLightLevel} ~onSpawn
ENDERMAN:
Skills:
- skill{s=LowerLightLevel} ~onSpawn
WITCH:
Skills:
- skill{s=LowerLightLevel} ~onSpawn
ZOMBIE_VILLAGER:
Skills:
- skill{s=LowerLightLevel} ~onSpawn
MythicMobs/Skills/ExampleSkills.yml
LowerLightLevel:
Conditions:
- lightlevel{level=2to7} true
Skills:
# - message{m="Lightlevel too low, removing ..."} @PIR{r=150}
- remove @self
(Note: If anyone has a better idea to accomplish my goal, then I would be very happy to hear about it.)
Priority
Low.