How do I spawn entities in the village?

Started by Andreius I on

Topic category: Help with Minecraft modding (Java Edition)

Active 3 years ago
Joined Jul 2021
Points:
490

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
How do I spawn entities in the village?
I made the "Guardian" entity. How to make it spawn in the village?
You can make it via global…
Thu, 07/22/2021 - 20:17

You can make it via global procedure with trigger "entity spawns".

Use condition "if entity = entity type >villager" then spawn Guardian on XYZ

You can of course make a bit offset, so it will be X+1/2 or Z+1/2, so they don't stack together (though they will move eventually, so it's not that important).

You can also make chance of Guardian spawning, because with procedure above, Guardian will spawn for every villager. So you can make easy additional condition to make it appear, for example, 20% of time, like here:

entity

(yes, I spawned bandit instead of Guardian, serving opposite purpose, but you see, they really need guardians with such cruel modders like me :P)

"Random [0,1]" gives you random between 0 and 1, so if you multiply it by 100, you will get percent drawing procedure.

Active 3 years ago
Joined Jul 2021
Points:
490

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
Thank you! But when I set…
Fri, 07/23/2021 - 15:27
Thank you! 
But when I set the "Spawn weight" to 1 for example, they spawn everywhere. 
And I need them to spawn ONLY in the village. How to implement this? 
I tried to figure it out myself but failed.
Active 1 week ago
Joined Feb 2024
Points:
72

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
First follow exactly what…
Fri, 02/23/2024 - 06:18

First follow exactly what Toma400 said, he was spot on. Then turn off "Enable entity spawning" because were not using that kind of spawning since we made the global procedure

Ecample

 

For anyone new seeing this, on an entity spawn it first checks if the entity is a villager. T

hen I used a [is (random number) the same as (fixed number)] to make odds, the one in my example is 1 out of 7 chance.

Active 1 week ago
Joined Feb 2024
Points:
72

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
A small change as I'm still…
Fri, 03/01/2024 - 20:06

A small change as I'm still learning myself, you can import a better odds template in the procedure templates, very useful for all procedures to look into it 

Active 2 months ago
Joined Jan 2024
Points:
76

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
@ChaseIsSexy   The procedure…
Sun, 12/29/2024 - 04:16

@ChaseIsSexy

 

The procedure you sent didn't work naturally, the code only worked if you spawned the mob. I am not that good at doing procedures, but I wonder if there anyway to fix this issue.

Active 2 months ago
Joined Jan 2024
Points:
76

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
Update, I tested some things…
Sun, 12/29/2024 - 16:58

Update, I tested some things, and I think "Entity Joins the World" instead of "Entity Spawns," actually worked for me.