Started by
Callofmc
on
Topic category: Help with Minecraft modding (Java Edition)
I have this mob i want to only spawn underground/caves however i do not see a way to do it now i could be blind but i don't see a way to do it
Topic category: Help with Minecraft modding (Java Edition)
I have this mob i want to only spawn underground/caves however i do not see a way to do it now i could be blind but i don't see a way to do it
A safe way to do this would be to make the entity spawn below y = 50 or so. This is below sea level so they will not spawn above ground.
Where is this at, thank you
rmsandegs, but how to do it?
How do we make it spawn below y=50 ??
Dang, this is dedication. I didn't get email notifications for the other ones but I did for that last one.
Anyways, create a procedure that triggers "on entity initial spawn" that checks "if y >= 50" if that is true, then your mob is above the ground, so despawn it using the "despawn mob" block.
Oh, and you can also check if "get block at x y z = CAVE_AIR", which is a special kind of air that only spawns in caves underground.
rmsandegs Thx a lot dude
rmsandegs can you teach me how to do everything you just explained (i just started MCreator 3 days ago and im a huge noob sorry)
Sure, so in the "triggers" section of your entity, create a procedure in the "initial entity spawn" section that detects if
A. Y is less than 50 or so (Y can be found in the Minecraft section of the procedure menu), or
B. Block at x, y, z == Cave Air
I suggest B because it is a little more versatile, for example ground level is much higher in extreme hills than, say, the ocean. So a hard value of y = 50 might not be ideal for a "one-size-fits-all" solution.
https://imgur.com/a/KkYErQf
Hey,
I recently came across this post and honestly Option B worked amazingly, however, is there a way to make it so if the mob is deliberately spawned (Spawn Egg or command) that they don't despawn? So this way they can only spawn naturally in caves but can be spawned elsewhere (kind of like bats)
Hmm... This is an interesting one. With commands, you can force a mob to never despawn by using the NBT tag {PersistenceRequired:1}. This works for all mobs.
As for spawn eggs, though, the only way I could see this being done is to detect a player within 5 blocks of where the entity spawns (this procedure block is only available in the 2020.4 snapshots), then setting the PersistenceRequired tag to 1 using the /data merge command in the "execute command" procedure block. This shouldn't have any false positives because mobs are programmed to spawn a minimum of 20 blocks away from any players.
Alright, I'm going to try this, thank you!
Also as someone who is new to modding and Mcreator, I just want to ask will I be able to update my current project to the latest updates, and will switching to newer snapshots mess stuff up?
Thanks again!
I would always back up you project before updating to snapshots, I learned that the hard way :p
So far, I've been using 2020.4 since the first snapshot launched and I haven't had problems, but you never know.
Hello! I have problems with the construction of the procedure itself, could you attach a screenshot, option B please?