The problem: Minecraft is horrible at implementing large numbers of villagers and other NPC types, so if you try to create a populated enough city your server will take a huge performance hit.
Bait allows creating points of interest that will summon "roaming" NPCs with very simple AI when a player is close, and unload when the player is not close anymore. This creates an illusion of a more populated urban center.
| item | loot table |
|---|---|
Bait |
bait:bait |
Holding the Bait on the main hand will show the positions of baits in a 3x1x3 box of chunks centered in the player as particle effects:
| color | meaning |
|---|---|
| Gold | The bait is owned by the player and can be removed. |
| Teal | The bait is owned by someone else and can't be removed. |
Using the Bait on any block will destroy an existing bait in that space, or create it if there was none by the current player.
Baits will attract many NPC types:
Every second it performs a number of checks:
For any player that has moved between chunks since the last check, if any chunk in a 3x3x3 chunk box around each player contains unspawned roamers, spawns them.
For any player that is holding a Bait, if any chunk in a 3x1x3 chunk box around them contains baits, spawns a particle for each one.
If any player has moved between chunks since the last check, for every chunk in the loaded list, if no player is close enough to one, remove the loaded roamers and remove the chunk from the loaded list.
Teleporting away from chunks holding roamers or otherwise moving from them at very high speeds will result in them being unloaded by the game before the datapack can do so; in those situations the datapack will temporarily forceload the chunk, remove the roamers, and deforceload it.
None.