Skip to content

Repository files navigation

SilkSpawners - A lightweight plugin to make spawners mineable
Latest Release Release Status Build Status Tested Versions CodeFactor Crowdin Localization
This plugin makes spawners minable using SilkTouch tools.
Compatible with Paper, Spigot, Purpur, Bukkit and Folia servers.

Visit on Modrinth Visit on Hangar Visit on Spigot

Contributing

Contributions and translations are welcome. See Contributing for more.

Building

Requirements: JDK 17 (any distribution)

Simply download the source and build it using Gradle.

./gradlew :Plugin:assemble --no-daemon

Your build of SilkSpawners will be available at build/libs/SilkSpawners_v2.jar.

The plugin is wired by weftkit, the compile-time lifecycle framework for Bukkit plugins that grew out of this project.

QuickStart

Want to use SilkSpawners without configuring permissions or anything else? Install the plugin and run this command as an admin or from the console, then confirm as prompted:

/silkspawners setup

Commands

  • /silkspawners help [command]
  • /silkspawners give <player> <entity> [amount]
  • /silkspawners set <entity>
  • /silkspawners explosion <enable/disable/setting> <player>
  • /silkspawners locale <setting/reload/restore>
  • /silkspawners config <reload/get/set> [setting] [value]
  • /silkspawners config explosion <list/add/remove> [all/normal/silktouch] [values]
  • /silkspawners setup [confirm/revert]
  • /silkspawners entities
  • /silkspawners version
  • /silkspawners dump

Permissions

Commands

  • silkspawners.command.give - Use this command to give spawners to players.

In addition, set silkspawners.command.give.* to allow all entities or replace the star with an entity name.

  • silkspawners.command.set - Use this command to change already placed spawners.

In addition, set silkspawners.command.set.* to allow all entities or replace the star with an entity name.

  • silkspawners.command.explosion - Use this command to temporarily enable or disable spawner explosions for a specific player.
  • silkspawners.command.locale - Use this command to reload and restore locale files.
  • silkspawners.command.config - Use this command to view and reload the configuration, including the explosion tiers.

In addition, set silkspawners.command.config.set to allow changing settings and explosion tiers.

  • silkspawners.command.setup - Use this command to disable or restore the permissions needed to use spawners.
  • silkspawners.command.entities - Use this command to see the entities you can use in permissions and commands.
  • silkspawners.command.version - Use this command to see if updates are available.
  • silkspawners.command.dump - Use this command to create a diagnostic report for support requests.

Spawners

  • silkspawners.break.* - Permission to set if players will receive destroyed spawners.
  • silkspawners.place.* - Permission to set if players can place silk spawners.
  • silkspawners.change.* - Permission to set if players can change spawners with eggs.
  • silkspawners.explosion - If set, spawner explosion is enabled.

If you want to allow only specific types of spawners you can replace the * with an entity name. Use the entities command to see spawnable entities.

Configuration

Default configuration:

messages:
  prefix: $8[$bSilkSpawners$8] # The plugin prefix used in all messages
  locale: en # The locale file to be used
spawner:
  dropChance: 100 # Probability that the spawner will drop when mined (0-100)
  destroyable: true  # If set to false, it won't be possible to destroy spawners without SilkTouch or without the permission
  pickaxeRequired: true # If set to false, spawners will always drop regardless of what the player is holding in his hand
  silktouchRequired: true # If set to false, spawners will drop even if the used pickaxe does not have SilkTouch
  silktouchLevel: 1 # The minimum SilkTouch level the pickaxe needs to mine spawners, at least 1 (useful for custom pickaxes with higher enchantment levels)
  item:
    name: $d{entity} Spawner # The name of the spawner item dropped, {entity} is replaced with the mob name
    color: $e # The color of the mob name in chat messages
    prefixOld: [] # Lore prefixes used by spawner items from older plugin versions, kept so those items stay recognized
    lore: ['$7Spawns $e{entity}'] # The lore of the spawner item, {entity} is replaced with the mob name
  explosion:
    all: [] # Explosion tiers rolled whenever spawners are mined, with or without SilkTouch (see below)
    normal: [] # Explosion tiers rolled when spawners are mined without SilkTouch (see below)
    silktouch: [] # Explosion tiers rolled when spawners are mined with SilkTouch (see below)
  message:
    denyDestroy: true # If set to true, a message will be sent to the player if the spawner cannot be destroyed
    denyPlace: true # If set to true, a message will be sent to the player if the spawner cannot be placed
    denyChange: true # If set to true, a message will be sent to the player if the spawner cannot be changed
  permission:
    disableDestroy: false # If set to true, no permission is required to receive destroyed spawners
    disablePlace: false # If set to true, no permission is required to place spawners
    disableChange: false # If set to true, no permission is required to change spawners with eggs
update:
  configVersion: 4 # Do not change this value manually! It is automatically managed by the plugin
  check:
    enabled: true # If set to true, the plugin will check for updates
    interval: 24 # The interval in hours at which to check for updates, at least 1
hooks:
  shopguiplus: true # If set to true, SilkSpawners will hook into ShopGUI+ if it is installed

If you want to use a dollar sign in a value, you can escape it by putting a backslash in front of it.

All messages (in the configuration and in locale files) can be formatted with either legacy color codes or MiniMessage tags. Mixing both formats within the same message is not supported.

Changing settings in game:

  • /silkspawners config get <setting> shows the current value and what the setting does
  • /silkspawners config set <setting> <value> changes it in the config.yml file

Settings and values are tab completed. Changing settings requires the silkspawners.command.config.set permission. Changes take effect immediately, except for hooks.shopguiplus, which needs a server restart. Lists can only be changed in the file, and explosion tiers are managed with /silkspawners config explosion (see below).

Explosion tiers:

explosion.normal and explosion.silktouch each take a list of tiers, and explosion.all tiers apply on top of both. On each break (by a player with silkspawners.explosion), one roll picks at most one tier: each tier's chance is its percentage share and must have a power. Shares under 100% leave the remainder as no explosion (power: 0 is an explicit no-explosion share); shares over 100% are scaled down proportionally. A silktouch explosion fires before the item drops, so it never destroys the drop. The example below gives 50% a small explosion, 30% a large one and 10% a massive one that ignites fires:

spawner:
  explosion:
    normal:
    - chance: 50 # This tier's share of a single roll, in percent (decimals allowed, default 100)
      power: 2.0 # Required: the explosion strength (TNT is 4.0); 0 means no explosion
    - chance: 30
      power: 4.0
    - chance: 10
      power: 8.0
      setFire: true # Optional: the explosion ignites fires (default false)
      breakBlocks: true # Optional: the explosion damages surrounding blocks (default true)

Changing tiers in game:

  • /silkspawners config explosion list [all/normal/silktouch] shows the configured tiers
  • /silkspawners config explosion add <all/normal/silktouch> <power> [chance] [setFire] [breakBlocks] adds a tier
  • /silkspawners config explosion remove <all/normal/silktouch> <tier> removes a tier by its number in the list

Adding and removing tiers requires the silkspawners.command.config.set permission. Changes made with the command take effect immediately. Changes made in the file take effect after /silkspawners config reload or a server restart.

Custom messages

New and reworded messages are applied to your locale files automatically on startup. Messages you edited yourself are never touched, so a customized message keeps its wording across updates.

Use /silkspawners locale restore confirm only to discard your own edits and return every message to the bundled default. If you want to create your own locale file, you should create a new file to prevent your changes from being overwritten when you restore the locale files. Locale files must be named accordingly to the messages_myfile.properties naming schema and can be used by setting myfile as locale.

If you have created your own translation, it would be awesome if you could submit it at our translation program, so other people can use it too.

FAQ

Common questions and problems are answered in the FAQ.

Support

If the FAQ does not cover your problem, open an issue. Running /silkspawners dump creates a diagnostic report - plugin, server and Java versions, the installed plugins and your configuration - on pastes.dev and replies with a link to attach to the issue. If it cannot be shared, the report is written to the plugin folder instead.

Integrations

EconomyShopGUI

EconomyShopGUI supports SilkSpawners out of the box, so spawners bought and sold in its shops are SilkSpawners items. Its spawner-provider option detects SilkSpawners automatically when set to AUTO (the default), or can be pinned with spawner-provider: SILKSPAWNERSV2.

ShopGUI+

If ShopGUI+ is installed, SilkSpawners automatically registers itself as its spawner provider, so spawners bought and sold in shops are SilkSpawners items. The hook can be disabled by setting hooks.shopguiplus to false in the configuration.

For developers

SilkSpawners provides a developer API with a SilkSpawnersAPI service and custom Bukkit events. See the Developer documentation for details.

Tutorial

SilkSpawners Tutorial

Thanks to KasaiSora for creating this great tutorial!

Statistics

Statistics Statistics from bStats

Releases

Used by

Contributors

Languages