How to make hostile mobs spawn in the light

Started by COMMANDO66 on Fri, 11/18/2022 - 21:57

Topic category: Help with modding (Java Edition)

Last seen on 19:12, 22. Jan 2023
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to make hostile mobs spawn in the light
Fri, 11/18/2022 - 21:57

I have some mobs that should be able to spawn regardless of light level. They are hostile and are intended to be so.

 

This wouldn't be so much of a problem if it was just a day and night thing, but the biome they spawn in gets constantly bombarded with projectiles that leave fire; this means the mobs can basically never spawn because of this.

 

Is there a workaround with procedures or other similar shenanigans to make stuff spawn irrespective of the light?

Last seen on 03:11, 29. Nov 2022
Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
First thing is first,…
Sun, 11/20/2022 - 06:19

First thing is first, monsters can only spawn at night or in the dark, so you would have to swap the spawning type to ambient under the spawning tab. This would allow your entity to spawn in the light.

 

Second, if you still only want the entity to spawn at night, instead of setting it to a monster spawning type, keep it as an ambient spawn type and make a custom spawning procedure using the spawning conditions trigger under the spawning tag.

    In this procedure, use an if-do statement that will return true if Is it day in provided world = false

That way the entity will spawn at night but because it is using ambient spawning, it SHOULD ignore light levels.

The procedure should look something like this

if [[is it day in provided world]=[false]
do 
	[return [true]
[return [false]