#How to make entity spawn above certain block (with EntityJS)

17 messages · Page 1 of 1 (latest)

real jungle
#

I'm trying to make thermal:blitz spawn on block aether:cold_aercloud in dimension aether:the_aether.
Here is my current code that worked (to spawn according to the standard spawn rules) until I added the startup predicate:

//startup
EntityJSEvents.spawnPlacement(event => {
    event.or('thermal:blitz',(entitypredicate, levelaccessor, spawntype, blockpos, randomsource) => {
        return levelaccessor.level.dimension == 'aether:the_aether' && levelaccessor.getBlockState(blockpos.below()).getBlock().getId() == 'aether:cold_aercloud'
    });
});

//server
EntityJSEvents.biomeSpawns(event => {
    event.addSpawn('thermal:blitz', ['#aether:is_aether'], 20, 6, 15);
});
boreal chasmBOT
#

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

night badger
#

@midnight knoll

midnight knoll
#

try event.replace instead of event.or js EntityJSEvents.spawnPlacement(event => { event.replace('thermal:blitz',"on_ground","world_surface", (entitypredicate, levelaccessor, spawntype, blockpos, randomsource) => { return levelaccessor.level.dimension == 'aether:the_aether' && levelaccessor.level.getBlock(blockpos.below()).id == 'aether:cold_aercloud' }) })

midnight knoll
#

if that doesnt work then maybe aether has some custom logic to prevent non aether mobs from spawning in the aether which would be very cursed

#

so far im not seeing any vanilla mobs in the dimension which makes me think this is the case hmmm

real jungle
#

ye it doesnt work unfortunately

#

its weird bc without the startup script it just spawns according to its normal rules

midnight knoll
#

yeah i'd take a look at a mod like incontrol for this in that case

#

if they're doing something freaky it might be your only option

real jungle
#

aight, thanks for your help

real jungle
#

I think i'll need to manually change this property

real jungle
#

I love coding, spending like 6 hours to fix 1 tiny problem 😂