Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
MythicMobs MythicMobs
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 136
    • Issues 136
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • MythicMobsMythicMobs
  • Issues
  • #516

Closed
Open
Created Aug 18, 2021 by Garten Zwerg@gartenzwerg89

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.

Edited Aug 19, 2021 by Garten Zwerg
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking