MergedSpawner icon

MergedSpawner 14.3.6

Stack multiple mob spawner (of the same kind) into just one spawner.

(SilkSpawner/TokenEnchant/MergedMob etc support included!)

NOTE:  This plugin does not provide active mob spawn mechanism.  It acts on underlying spigot/bukkit's creature event.

For Plugin Support, please use the support site.  You can also use 
[dropdown=vk2gpz plugin support channel]https://discord.gg/0tDXCzCF7DPbdlFd[/dropdown]

NOTICE: If you have stacked mobspawners created by pre v4.0.0 MergedSpawner plugin, they will automatically be updated to the newer merged spawners when one of the following happens:
  • add/remove a spawner,
  • mobs are spawned from the old merged spawner.

Since there is not any mobspawner merge plugin which does what I wanted, I made this...

How it works:
You first place a mob spawner, then you hit the placed mob spawner with another one (of the same kind).  The new one will not be placed (on/under/next to), but merged.  If you "break" the merged mob spawner, the count of the merged spawner will be decremented.

This plugin does not have mob stacking function. All spawned mobs are regular vanilla mobs.  Ofc, this plugin works fine with plugin like MergedMob as shown in the video below.

Video demo

NOTE: The mob stacking in the video is done by MergedMob plugin.  The information display header says "MergedMob" but it was my typo.

This shows that MergedSpawner working on GemSpigot server.


This plugin allows you to virtually stack mobspawner block of the same EntityType.  By using this merged mobspawner, you will significantly reduce the space required to build your mob grinders.  When mobs are spawned from the merged spawner, the number of spawned mob will be multiplied according to the number of merged spawners.

If plugins like MergedMob, SilkSpawners, this plugin will work with those plugins.  This plugin may not be work with some plugins, which carelessly hijacks events and not allowing other plugins to process those hijacked events.

Commands: (alias: mspawner)
  • /mergedspawner | /mergedspawner help : displays the help menu
  • /mergedspawner reload : reloads the configuration file.
  • /mergedspawner info : displays the information on the spawner you're looking at.
  • /mergedspawner clean : (in case the plugin malfunction and left orphant markers on the map) cleans out all the orphant markers on the map.
  • /mergedspawner give : gives spawner of type .
  • /mergedspawner set [amount] : changes the mob type of the spawner you're looking at to and set the stacked size to [amount].
  • /mergedspawner fix : try to fix the spawner data based on the 'MergeMode:' option in the config.yml
  • /mergedspanwer sethand : changes the mob type of the spawner you're holding at to .

Permission Node:
  • mergedspawner.reload : allows you to reload the config file.
  • mergedspawner.clean : allows you to execute "clean" command.
  • mergedspawner.give : allows you to use "give" command.
      permissions added from v12
  • mergedspawner.* (false) : Grants access to all other permissions
  • mergedspawner.place.* or mergedspawner.place. : Allows you to place a spawner
  • mergedspawner.silkdrop.* or mergedspawner.silkdrop : Allows you to use silk touch to acquire mob spawner item.  To use this perm, make sure to give your player the following (mergedspawner.destroydrop.* or mergedspawner.destroydrop. perm node as well)
  • mergedspawner.destroydrop.* or mergedspawner.destroydrop. : Allows you to destroy mob spawners.
  • mergedspawner.explodedrop : Allows you to receive drops from exploded spawners
  • mergedspawner.changetypewithegg.* or mergedspawner.changetypewithegg. : Allows you to change the spawner type by clicking with a spawn egg
  • mergedspawner.set.* or mergedspawner.set. : Allows you to use "set" command.
  • mergedspawner.set.amount.* or mergedspanwer.set.amount. : Allows you to use "set" command with "amount" option.
  • mergedspawner.sethand : Allows you to use sethand command.

Installation:
You just install MergedSpawner.jar into "plugins" folder.

Configuration:
[dropdown=config.yml]

Messages:
  ErrorMsg : "&c[MergedSpawner] : Some error occured."
  OrphanRemoved : "&a[MergedSpawner] : an orphan marker removed."
  OrphanRemoveComplete : "&a[MergedSpawner] : Orphan marker removal completed."
  MaxReached : "&a[MergedSpawner] : the max count has been reached!"
  NoPermPlace : "&c[MergedSpawner] : You don't have a permission to place a mobspawner of type &e%type%&c."
  NoPermChange : "&c[MergedSpawner] : You don't have a permission to change a mobspawner of type &e%type%&c."
  TypeChanged: "&a[MergedSpawner] : the mob type has been changed to &e%mobtype%&a."
  SizeChanged: "&a[MergedSpawner] : the stack size has been changed to &e%amount%&a."
  NoSuchType: "&a[MergedSpawner] : No mob type &e%mobtype% &aexists."
  NoPermDrop: "&c[MergedSpawner] : You don't have a permission to mine a spanwer of type &e%type%&c."

HelpMessages:
  banner:
    msg: "=== &e[&aMergedSpawner Commands List (%version%)&e] &r==="
  help:
    msg: "&a/mergedspawner help : displays this help menu."
  reload:
    msg: "&a/mergedspawner reload : reloads config file."
    permission: "mergedspawner.reload"
  debug:
    msg: "&a/mergedspawner debug : turn on / off the debug mode."
    permission: "mergedspawner.debug"
  info:
    msg: "&a/mergedspawner info : displays the information on the spawn you're looking at."
    permission: "mergedspawner.info"
  clean:
    msg: "&a/mergedspawner clean : removes all orphan markers."
    permission: "mergedspawner.clean"
  give:
    msg: "&a/mergedspawner give : gives spawner of type ."
    permission: "mergedspawner.give"
  set:
  msg: "&a/mergedspawner set [amount]: changes the mob type of the spawner you're looking at (or the spawner you're holding) to and set the stacked size to [amount]."
    permission: "mergedspawner.set"
  news:
    msg: "&a/mergedspawner news : display the news associated with the current release."
    permission: "mergedspawner.news"

# This option allow you to chose how the merged spawners are internally managed.  The newer mode 1 and 2 might trigger
# a bug in NMS and cause the some spawner to turn back into a pig spawner.  However, newer mode will significanly
# reduce the lag when an excess amount of spawners are stacked.
# It is strongly recommended to test mode 2 and 1 on your test server before you switch to those mode.
#
# 0 : very old stable mode but work on any version, but it may start lagging if you have excess amount stacked
# 1 : up to 1.12
# 2 : from 1.13
# 3 : as of MergedSpawner v10, this is the only version supported.
MergeMode: 3

NumberRegex: "([0-9]+)(X)"     #this corresponds to %number%X in CustomNameFormat
CustomNameFormat: "&d%number%X &6%type%"

# if you're using SilkSpawner, set BlockPlaceEventPriority to MONITOR
# adjust these event priority if those event processes from this plugin
# interfere with other plugins' event processes.
EventPriorityMap:
  BlockPlaceEvent: "MONITOR"
  BlockBreakEvent: "MONITOR"
  BlockExplodeEvent: "MONITOR"
  EntityExplodeEvent: "HIGH"
  SpawnerSpawnEvent: "HIGHEST"
  TEBlockExplodeEvent: "LOW"
  PlayerInteractEvent: "LOW"

# if this option is true, mined spawner will automatically be placed in your inventory
# if the inventory is full, it will be dropped at spawner's locaation
AutoPickup: false

# if this option is true,
# shift + Silktouch mine will mine all stacked spawners
ShiftMineAll: false

# if this option is true,
# shift + place a spawner will try to place all stacked spawners
ShiftPlaceAll: false

# Default Max  if the max stack number is not provided for individual mob type under Mobs:
# This default max number will be used.  If this value is -1, No limit will be applied.
DefaultMax : -1

# This radius is used to search the existing mob spawner of a same type when you "place" a new spawner
# The newly placed spawner will be merged into the found existing spawner.
MergeRadius : 1

# disallow the use of mob eggs to change the spawner type.
AllowMobEgg : true

# this option will determin whether spawner will be exploded one by one or all at once.
# option : ONE or ALL  (default: ALL)
ExplodeDrop: ALL

# SilkSpawner like drop chances.
DefaultExplosionDropChance : 30
DefaultDestroyDropChance : 100
DefaultSilkDropChance : 100
PermissionToExplode: true

# Inspection tool
InspectionTool: BONE  # if you specify AIR, you can hit with a hand.
InspectionDuration: 5 # in seconds
LookToInspect: false # when this is true, you can see the spawner information by just looking.

InfoFormat:
  - "&a===== &eMergedSpawner &a====="
  - "&aMob Type: &b%type%"
  - "&aSpawner Count: &b%count%"

# if this option is true, a plyaer without mergedspawner.destroydrop.* will get a warning.
# The 1st attempt to mine a spawner will be cancelled.
WarnNoPerm: false
WarnInterval: 30 # in seconds.

# MobAliases option is deprecated. if you wish to change the name of the spawner
# please use "alias:" under "Mobs:" section.
MobAliases:
#  COW: "&aCowCow"

Mobs:
  COW:
    alias: "&aCowCow"
    max: 10
    count_per_spawn: 1
    explosion_drop_chance: 100
    destroy_drop_chance: 100
    silk_drop_chance: 100
  BLAZE:
    max: 20
    count_per_spawn: 3

[/dropdown]

For Developers:
You can develop your plugin, which talks to MergedSpawner using MergedSpawnerAPI.  If you have a plugin, from which you wish to find out how many spawners are stacked in the spawner, you can invoke the following static method:

MergedSpawner.getCountFor(Block spawner);


If you wish to use an event-driven approach, you can use the follwing events:

@EventHandler
public void onMergedSpawnerPlaced(MergedSpawnerPlaceEvent e) {
    Block spawnerBlock = e.getSpawner();
    int newCount = e.getSpawnerCount();
    EntityType type = e.getSpawnerType();
    ...
}

@EventHandler
public void onMergedSpawnerBroken(MergedSpawnerBreakEvent e) {
    Block spawnerBlock = e.getSpawner();
    int newCount = e.getSpawnerCount();
    EntityType type = e.getSpawnerType();
    ...
}