#how to make zombies appear during the day, and how do I make them appear together

34 messages · Page 1 of 1 (latest)

median wraith
#

how to make zombies appear during the day, and how do I make them appear together

summer pagodaBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

alpine aurora
#

@restive sun do you know how spawning rules work? i have never dealt with it

restive sun
#

already on it heh

alpine aurora
#

🐐

median wraith
restive sun
#

biel do you want to completely replace the spawns or just add them during day

median wraith
#

just add

restive sun
median wraith
#

ok

restive sun
#

you'll probably want the "or" predicate

alpine aurora
#

hmm, check is it is day and return true?

median wraith
#
EntityJSEvents.spawnPlacement(event => {
  /**
   * @param replace Replaces the given entity type's spawn rules
   * Ensure zombies spawn everywhere with no restrictions.
   */
  event.replace('minecraft:zombie', 'no_restrictions', 'world_surface', (entitypredicate, levelaccessor, spawntype, blockpos, randomsource) => {
      return true;
  });
});```


he is saying that EntityJSEvents was not defined, is this documentation suitable for 1.20.1?
alpine aurora
alpine aurora
median wraith
#

oh

alpine aurora
#

it is a KubeJS Addon

median wraith
#

sorry I'm new to this

median wraith
restive sun
#

thought i may or may not have to push an update so you can get the zombie in question because right now you can get the entity type but not the actual entity hmmm

#

though you may not even need it tbh

#

cause all it is is this for zombie java public static boolean checkMonsterSpawnRules(EntityType<? extends Monster> pType, ServerLevelAccessor pLevel, MobSpawnType pSpawnType, BlockPos pPos, RandomSource pRandom) { return pLevel.getDifficulty() != Difficulty.PEACEFUL && isDarkEnoughToSpawn(pLevel, pPos, pRandom) && checkMobSpawnRules(pType, pLevel, pSpawnType, pPos, pRandom); }

#

@median wraith try this in startup js let Monster = Java.loadClass("net.minecraft.world.entity.monster.Monster") let Mob = Java.loadClass("net.minecraft.world.entity.Mob") let Difficulty = Java.loadClass("net.minecraft.world.Difficulty") EntityJSEvents.spawnPlacement(event => { event.replace('minecraft:zombie', "on_ground", "motion_blocking_no_leaves", (entityType, levelAccessor, spawntype, blockpos, randomsource) => { let level = levelAccessor.level return level.getDifficulty() != Difficulty.PEACEFUL && (Monster.isDarkEnoughToSpawn(level, blockpos, randomsource) || (!Monster.isDarkEnoughToSpawn(level, blockpos, randomsource) && level.isDay())) && Mob.checkMobSpawnRules(entityType, level, spawntype, blockpos, randomsource); }); }); it mimics the spawn rules for zombie and i added another check in there to see if its not dark enough to spawn and its daytime

median wraith
#

How can jei developer mode get the ids?

restive sun
#

ids as in autocomplete?

#

oh

#

wym exactly?

median wraith
#

I want to disable structure generation from a mod

restive sun
#

that is a seperate ticket heh

#

??closeticket

plain steepleBOT
# restive sun ??closeticket

Please close your ticket (with </ticket close:1054771505520717835> or the button atop this thread) once you resolved your issue! This also helps others that would like to help out, as they don't have to look into this thread to check if it has been resolved by now.

Do you have any other questions regarding your issue? Feel free to ask!
Note: You should generally create a new post for unrelated issues.

median wraith
#

ok