How to make my mob spawn nowhere buy my structure

Started by HuskFan on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make my mob spawn nowhere buy my structure

How would I make a mob only spawn in my structure? I know how to get it to be in the structure but how to get it to be in my structure and nowhere else?

Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make a custom block that…
Thu, 04/24/2025 - 15:59

Make a custom block that looks the same as whatever you are building your structure from, with same texture, same stats, and that if broken, it drops the block it is supposed to be, but make it tick (either at a constant rate or randomly, depending on how you want your mobs to spawn. Then make a procedure on that tick rate you choose that spawns the mob. Only use this block in your structure, and stop it from spawning naturally, and do the same for your mob.

You can also make it so if it is destroyed, it looks for a block of a similar type of the one it is supposed to be, and replaces it with a copy of itself, so mobs keep spawning around even if the player destroys it without knowing. I would recommend you to give it an NBT number tag to the block (and inherit it to the next one when destroyed) so you can check how many times it has been destroyed and stop it from spawning after a specific number of times, so the mobs don't keep spawning even if the player destroys the entire structure and surrounding area.