Started by
mobcrafter731
on
Topic category: Help with Minecraft modding (Java Edition)
In a custom dimension, the roof and floor of the world is a custom block. I want this block to act like bedrock, where mobs cannot spawn on the block. I don't want there to be tons of mobs on the world's ceiling. How do I make the block do this?
Edited by mobcrafter731 on Mon, 03/01/2021 - 12:34
Hello @mobcreafter731
I was trying to do something similar for my own mod, and the solution that ended up working for me is to just make the block's hitbox ever so slightly shorter then a normal block.
So like if a normal block hitbox is 16 pixels tall make your block's hitbox 15.9955 pixels tall instead, this works because mobs can only naturally spawn on full/normal blocks so by making your block slightly less then a full block you can prevent natural spawning entirely!
Hope this helps!!! :D
Edit: I meant bounding box instead of hitbox, sorry for the confusion! :P