Villages are fixed once a world is created. In your entity class, override getCanSpawnHere and use this.world.getVillageCollection().getNearestVillage to find nearest village, then allow your mob to spawn if it is n blocks away from the village center.
well you gotta write code at some point. mcreator is just a starting point for beginner modders learning to mod, it creates a simplified build environment for people that don't know how to set it up, and acts like a tutorial in many ways. but in the long run if you want to make a mod that really does things you will need to code.
Alternatively, you can add a 'custom spawning condition' on the spawning tab of the entity which includes the 'check for block in 6x6x6' procedure template with the Block being defined as the Bell (found naturally spawning in the center of villages and uncraftable without mod or datapack) which uses the if statment to 'Returns true' if it is found, and put 'Return false' under that so it defaults to false, so it'll only spawn in that 6x6x6 box in the center of town... That'swhat I did for a mod I am making.
Much easier than all that's been said here, i'm using village spawn entity since years
On entity in natural spawn trigger use: return: does exist villager or iron golem in radius you want (for example 10 would be most of time inside village)
Just an hint for you: this works only for monster / ambient type entities not creatures. If you wanna make a creature one just use monster / ambient and despawn when joins world and spawn creature type
You can make your mob spawn just outside the village and let him run in the village
you can't detect the village spawning.
Villages are fixed once a world is created. In your entity class, override getCanSpawnHere and use this.world.getVillageCollection().getNearestVillage to find nearest village, then allow your mob to spawn if it is n blocks away from the village center.
yeah but that's coding
well you gotta write code at some point. mcreator is just a starting point for beginner modders learning to mod, it creates a simplified build environment for people that don't know how to set it up, and acts like a tutorial in many ways. but in the long run if you want to make a mod that really does things you will need to code.
yes
but just sayin that this isn't possible with just mcreator
Alternatively, you can add a 'custom spawning condition' on the spawning tab of the entity which includes the 'check for block in 6x6x6' procedure template with the Block being defined as the Bell (found naturally spawning in the center of villages and uncraftable without mod or datapack) which uses the if statment to 'Returns true' if it is found, and put 'Return false' under that so it defaults to false, so it'll only spawn in that 6x6x6 box in the center of town... That'swhat I did for a mod I am making.
Or you can make a new procesure entity spawn, if entity=entityvillager do with %chance despawn entiy spawn entity= your entity at x y z
u can make a procedure with the trigger: when entity spawns:
IF: Entity sub/type of: villager:
DO: IF: Random:0.1< 0.15
DO: Spawn at X Y Z (your entity)
Much easier than all that's been said here, i'm using village spawn entity since years
On entity in natural spawn trigger use: return: does exist villager or iron golem in radius you want (for example 10 would be most of time inside village)
Just an hint for you: this works only for monster / ambient type entities not creatures. If you wanna make a creature one just use monster / ambient and despawn when joins world and spawn creature type