DenizenMC

Spawner Types

Define your own mob and item spawners in YAML.

Spawner types are defined in two files: mob_spawners.yml for mob spawners and item_spawners.yml for item spawners. Both use the same format, and each type has a name of your choice, which is what shows up in commands and tab completion.

Example

mob_spawners.yml
elite_zombie:
  entity: ZOMBIE
  experience: "15-25"
  drop_chance: 100
  icon:
    item: IRON_SWORD
  loot:
    1:
      item: IRON_SWORD
      amount: 1
      chance: 8
      durability: "20-80"
    2:
      item: EMERALD
      amount: "1-3"
      chance: 15

This creates a spawner called elite_zombie. Every cycle it gives 15 to 25 experience, has an 8% chance to make a worn iron sword, and a 15% chance to make one to three emeralds.

Type fields

Prop

Type

Loot entries

Prop

Type

An entry needs at least one of item, money or commands, and can have all three.

mob_spawners.yml
loot:
  1:
    item: DIAMOND
    amount: 1
    chance: 1
    pity: 150
  2:
    money: "1-3"
    chance: 50
  3:
    commands: ["crates key give %owner% vote 1"]
    chance: 0.1

How pity counts

Pity is tracked per spawner. With pity: 150, a spawner that misses 149 times in a row is guaranteed the drop on the 150th cycle. A hit resets the count. The count also resets when the server restarts.

drop_chance and chance, side by side

drop_chance decides whether the loot table gets rolled at all this cycle. Then each entry's chance is checked on its own. With drop_chance: 50 and an entry at chance: 50, that item drops about a quarter of the time.

Affinities

Affinities make a type better under the right conditions. Every condition you set has to match, and the ones you leave out are ignored.

mob_spawners.yml
zombie:
  entity: ZOMBIE
  affinities:
    night_shift:
      time: night
      bonus: 15
ConditionValues
timeday or night
weatherclear, rain or thunder. rain also matches during a thunderstorm
biomesA list of biomes, like [plains, deep_dark]
environmentsA list of normal, nether or the_end
bonusExtra loot and experience, in percent. Use loot-bonus and exp-bonus to set them separately

The default mob_spawners.yml comes with a few to start from: zombies at night, drowned in the rain and blazes in the nether.

Custom items

Any item, in loot, in an icon or in item-material, can be a custom item instead of a vanilla one:

item: EMERALD

Each one needs its plugin on the server. If an id is wrong, the console tells you once and the entry is skipped until you fix it.

Custom spawner items

Set item-material on a type, or spawner-items in config.yml for every type, to give the placeable spawner your own model. It still places a real spawner, stacks, and drops back when broken.

Icons

icon.item follows the same rules as loot items. To show a custom player head, set icon.item to PLAYER_HEAD and add icon.skull_texture:

icon:
  item: PLAYER_HEAD
  skull_texture: "<base64 value>"

Use the full value

skull_texture needs the complete base64 Value that head sites like minecraft-heads.com give you, not just the texture hash. It only works when icon.item is PLAYER_HEAD.

Applying changes

Save the file and run /esp reload. Spawners already in the world pick up the changes right away, since they remember their type by name.

Did this page help?

Last updated on