Mob Attractor is a simple plugin that will teleport select types of mobs towards other select types of mobs. The intended behavior is to teleport monster types towards players and villager. It is a simple but highly customizable system.
Example
Let's say you have built a house and are spending the day in it. Monsters will spawn in caves near your house. Some monsters will spawn quite far away. If you do not move, this plugin will over time bring the monsters to the closest non-explored cave near your house, like illustrated below.
Once it gets dark, the monsters have more spawn areas and will, if you do not watch over the area, show up on the surface.
Teleportation will happen multiple times throughout a Minecraft day/night, depending on the configuration. Mobs will never be teleport to a spot a player could see. So they will not just appear out of thin air.
Customizability
Customization includes:
One or more lists of teleported mob types.
One or more lists of mob types to teleport to.
Minimum and maximum teleport distance.
Minimum and maximum time interval (in seconds) between teleports (per mob).
A blacklist of block types the mobs cannot be teleport onto.
The minimum and maximum light level a mob can be teleported to.
Time multiplier (explained in the Configuration section).
To expand these capabilities even more the configuration allows you to add multiple sets of "attractors and attracted mobs". All settings except for the block type blacklist are separated into these sets. In the configuration file these sets are referred to as "records". These sets allow for many possibilities. For example, you could have villagers attract zombies, and have players attract creepers, zombies, spiders and skeletons. You can make any combination you can imagine. You could also have players attract zombies and have zombies attract creepers, to have creepers appear further back, for example.
Configuration
The default configuration looks as followed:
Code (YAML):
# MobAttractor's config file.
# You can add records with attractors EntityTypes, EntityTypes they will be attracting and various other settings. # Note that not all settings (e.g. spawn blacklist) are under a separate record and should only be here once # # Records' values: # Attractors: (Required) List of EntityTypes that will attract the "Attract" list over time and within given distance # Attract: (Required) List of EntityTypes that will be attracted by "Attractors" list over time and within given distance # Max distance mob: (Optional) The max distance an 'attract' mob is allowed to be away from an attractor in order to teleport towards it # Min distance mob: (Optional) # Max teleport distance: (Optional) The max distance an 'attract' mob is allowed to teleport in direction of an attractor at a time # Min teleport distance: (Optional) # Max interval in seconds: (Optional) The max interval in seconds in which an 'attract' mob may teleport # Min interval in seconds: (Optional) The minimum. A random number between min and max interval will be used. Also multipliers may alter total time # Near-attractors time multiplier: (Optional) If more than one attractor is close enough, the teleport duration is multiplied by this times (the amount of attractors - 1) # Max light-level: (Optional) The max light-level 'attract' mobs are allowed to teleport to # Min light-level: (Optional) # Extra Y shift: (Optional) Will add extra checks for teleport spots on the Y axis # # Teleport spawn blacklist (standard includes non-solid blocks): 'attract' mobs are not allowed to be teleported onto any of these block materials Example:
Attractors: - PLAYER
- VILLAGER
Attract: - BLAZE
- CAVE_SPIDER
- CREEPER
- EVOKER
- GUARDIAN
- HUSK
- ILLUSIONER
- MAGMA_CUBE
- SILVERFISH
- SKELETON
- SLIME
- SPIDER
- STRAY
- VEX
- VINDICATOR
- WITHER_SKELETON
- WITCH
- ZOMBIE
- ZOMBIE_VILLAGER
Max distance mob: 120.0
Min distance mob: 30.0
Max teleport distance: 50.0
Min teleport distance: 5.0
Max interval in seconds: 260.0
Min interval in seconds: 30.0
Near-attractors time multiplier: 0.9
Max light-level: 7
Min light-level: 0
Extra Y shift: true
Teleport spawn blacklist (standard includes non-solid blocks): - CACTUS
- OAK_LEAVES
- SPRUCE_LEAVES
- BIRCH_LEAVES
- JUNGLE_LEAVES
- ACACIA_LEAVES
- DARK_OAK_LEAVES
- MANGROVE_LEAVES
- AZALEA_LEAVES
- FLOWERING_AZALEA_LEAVES
Advanced configuration
The configuration below shows you an example of how to add multiple records of attractors and attracted types.
Code (YAML):
NPCS: Attractors: - VILLAGER
- IRON_GOLEM
Attract: - ZOMBIE
- ZOMBIE_VILLAGER
Max distance mob: 80.0
Min distance mob: 20.0
Max teleport distance: 50.0
Min teleport distance: 5.0
Max interval in seconds: 60.0
Min interval in seconds: 30.0
Near-attractors time multiplier: 0.8
Extra Y shift: true
Players:
Attractors: - PLAYER
Attract: - BLAZE
- CAVE_SPIDER
- CREEPER
- EVOKER
- HUSK
- ILLUSIONER
- MAGMA_CUBE
- SILVERFISH
- SKELETON
- SPIDER
- STRAY
- VEX
- VINDICATOR
- WITHER_SKELETON
- WITCH
- ZOMBIE
- ZOMBIE_VILLAGER
Max distance mob: 300.0
Min distance mob: 10.0
Max teleport distance: 100.0
Min teleport distance: 15.0
Max interval in seconds: 40.0
Min interval in seconds: 10.0
Near-attractors time multiplier: 0.5
Extra Y shift: true
Teleport spawn blacklist (standard includes non-solid blocks): - CACTUS
- OAK_LEAVES
- SPRUCE_LEAVES
- BIRCH_LEAVES
- JUNGLE_LEAVES
- ACACIA_LEAVES
- DARK_OAK_LEAVES
- MANGROVE_LEAVES
- AZALEA_LEAVES
- FLOWERING_AZALEA_LEAVES
Note that all options except "Teleport spawn blacklist" are present twice. The teleport spawn blacklist has to present only once as that is not tied to a record! Also note that min and max light levels are left out. Every setting except Attractors and Attract are optional and will use default values when left out. The server console will tell you what default values are used upon startup. But beware, the default values are not always the same as the values the default config has!
Some of the more advanced settings may be confusing and are explained in more detail here. Near-attractors time multiplier multiplies the waiting time (interval) between teleports with this value as many times as there are extra attractors. So if your attractor type is PLAYER and there are two players the interval is multiplied by this value once. If there are three it will be multiplied by this value two times (at least that's what I think it does, it's been years lol). It makes sense for this value to be between 0 and 1, as it will then lower the interval when more attractors are nearby. If Extra Y shift is set to true, the teleporting mob will check for more available teleport locations along the Y axis. How many more depends on the distance it teleports. Regardless of this setting, the first available location (within min and max distance) will be picked. However, if no suitable location was found within the allowed distance, no teleportation will take place and the mob will wait for the next interval to try again. Setting this to false will save performance but it is recommended to keep this on true. Teleport spawn blacklist (standard includes non-solid blocks) is a list of material types that mobs cannot be teleported onto. However, aside from these materials, all non-solid blocks are also blacklisted. Examples of non-solid blocks are fences, fire, water, flowers, vines etc. These non-solids cannot be removed from the blacklist, as there will most likely be a solid block below them the mob should teleport onto instead.
Known bugs
In rare occasions, big mobs like spiders will suffocate when teleported. There has been effort put into fixing this but it still rarely occurs.
This plugin should be compatible with versions 1.13 and up. This plugin was developed mostly in 2017.