Blocksmith logo
NextGens

Generators

Every generator lives inside the generators folder, and you can split them into as many files as you want. A file can hold one generator or a hundred, NextGens loads all of them on startup.

Generator ids must be unique across all files. If two generators share the same id, only one of them will be loaded.

Here is a fully commented example of a single generator.

# This must be unique
wheat_generator:
  # The display name of the generator that will be used across messages
  display-name: "#D8A073&lWheat Generator"
  # How often should the generator drop? (in seconds)
  interval: 20
  # If the generator is corrupted, it will break occasionally and the player needs
  # to fix it by shift + right-clicking the generator and paying the cost below
  corrupted:
    enabled: true
    cost: 12.5 # The cost to fix the corruption
    chance: 0.25 # Chance that the generator will be broken
  upgrade:
    # The generator that will be used upon upgrading
    # If you don't want the generator to be upgradeable, simply put "null"
    next-generator: melon_generator
    upgrade-cost: 50
  # The generator item itself
  item:
    material: HAY_BLOCK
    display-name: "#D8A073&lWheat Generator"
    # item-model: "minecraft:wheat"
    enchantments: [ ] # Format: <ENCHANT>;<LEVEL>, example: DURABILITY;1
    flags: [ ] # Example: HIDE_ATTRIBUTES, HIDE_ENCHANTS
    custom-model-data: 0
    lore:
      - "&8Purchasable Generator"
      - "&7&oPlace down to activate the generator"
  # List of drops that can be dropped from this generator
  drops:
    '0': # Unique identifier, it could be anything
      chance: 60 # The chance that this drop will be chosen
      sell-value: 8 # The sell value of the drop item
      commands: [ ] # Commands that will be executed instead of / along with the drop
      item:
        material: WHEAT
        display-name: "&e&lWheat &a(/sell for money)"
        custom-model-data: 0
        lore:
          - "&7Use &a/sell &7to sell this for &a&n$8"

Generator options

OptionDescription
display-nameThe name used across messages and menus
intervalHow often the generator produces a drop, in seconds
corrupted.enabledWhether this generator can be corrupted at all
corrupted.costHow much money the player pays to fix it
corrupted.chanceThe chance for this generator to be picked during a corruption wave
upgrade.next-generatorThe generator id this one upgrades into, use null to make it the final tier
upgrade.upgrade-costHow much money the upgrade costs
online-onlyOptional, only generate drops when the owner is online
itemThe generator item, follows the standard item format (material, display-name, lore, enchantments, flags, custom-model-data, item-model)
dropsList of possible drops, see below
place-requirementsRequirements the player must meet to place the generator
upgrade-requirementsRequirements the player must meet to upgrade the generator

Drops

Each entry under drops needs a unique key, and NextGens picks one of them every interval based on chance.

OptionDescription
chanceWeight of the drop, the higher the value the more often it is chosen
sell-valueThe sell value that is stored on the dropped item, so /sell and sellwands know its worth
commandsCommands executed from console when this drop is chosen
itemThe dropped item, can be omitted if you only want to run commands

Information

Commands support the {player}, {x}, {y}, {z}, {world} and {world_lower} placeholders.

Requirements

Both place-requirements and upgrade-requirements use the same format.

  place-requirements:
    '0': # Unique identifier, it could be whatever
      type: PERMISSION
      message: "&4&l[!] &cYou need to reach reborn level 2 first to place this generator!"
      permission: "tycoon.reborn.2"
    '1':
      type: PLACEHOLDER
      message: "&4&l[!] &cYou need at least level 90 to place this generator!"
      placeholder: "%alonsolevels_levels%"
      value: "90"
TypeExtra optionsDescription
PERMISSIONpermissionThe player must have the given permission
PLACEHOLDERplaceholder, valueThe placeholder result must be at least the given value

Corruption

Per-generator corruption is set up with the corrupted section above, but the corruption waves themselves are global and live in the corruption section of config.yml. Every wave picks a percentage of all placed generators, rolls each one against its own corrupted.chance, and breaks the unlucky ones until the owner repairs them by shift + right-clicking (or with /repairgens).

corruption:
  enabled: true
  # How often should corruption happen (in minutes)
  interval: 180
  # Should we corrupt the generator if the player are online?
  online-only: true
  # How many generators can possibly corrupt
  # Default: 10 (If there are 100 generators, 10 of them will be randomly chosen and tested for corruption)
  percentage: 10
  # Should we use gui to fix the corrupted generator?
  gui-fix: true
  # Broadcast when the corruption wave happen, leave empty to disable it
  broadcast:
    - '  &c&lPower Outages'
    - '  &fDue to recent power outages, &c&n{amount}&f generators'
    - '  &fhave been broken, please fix them immediately!'
  notify:
    interval: 5
    messages:
      - '  &fThere are &e&n{amount}&f of your generator that''s broken'
  # List of generators that cannot be corrupted
  blacklisted-generators:
    - disabled_generator
OptionDescription
enabledTurn the whole corruption system on or off
intervalHow often a corruption wave happens, in minutes
online-onlyOnly corrupt generators whose owner is currently online
percentageHow many of all placed generators are tested per wave
gui-fixOpen the repair GUI instead of repairing instantly on shift + right-click
broadcastServer-wide message when a wave happens, supports {amount}. Leave empty to disable.
notify.intervalHow often affected players are reminded, in minutes
notify.messagesThe reminder message, supports {amount}
blacklisted-generatorsGenerator ids that can never be corrupted
The floating BROKEN text above a corrupted generator is configured separately, see Holograms.

Events

Gens events are configured in events.yml. You can create as many events as you want and NextGens will run them one after another, or randomly if you enable random.

events:
  enabled: true
  # Should we choose a random event instead of starting them by order
  random: false
  # The wait time between each event (in seconds)
  wait-time: 900
  placeholders:
    no-event: '&7ɴᴇxᴛ ᴇᴠᴇɴᴛ'
    no-event-timer: '&7ᴇᴠᴇɴᴛ ɪɴ: &f{timer}'
    active-event: '{display_name}'
    active-event-timer: '&7ᴛɪᴍᴇ ʟᴇғᴛ: &f{timer}'
  events:
    2x_sell:
      type: sell_multiplier
      display-name: '&a&l2x Sell Multiplier'
      multiplier: 2.0
      duration: 120
      chance: 75
      only-by-command: false
      start-message:
        - '  #f69220Type: &f{name}'
        - '  #f69220Duration: &f{duration}'
      end-message:
        - '  #f69220Type: &f{name}'
        - '  #f69220Next Event In: &f{next_duration}'
      blacklisted_generators:
        - disabled_generator_id

Event types

TypeUnique optionDescription
sell_multipliermultiplierMultiplies the value of every sell during the event
generator_upgradetier-amountGenerators drop items from a generator a few tiers above them
generator_speedpercentageReduces the drop interval by that percentage
drop_multiplierdrop-amountGenerators produce more drops per interval
mixed_upGenerators produce drops from a random generator

Shared event options

OptionDescription
display-nameThe name shown in messages and placeholders
durationHow long the event runs, in seconds
chanceThe chance of being picked, only used when random is enabled
only-by-commandOnly startable through /gens startevent <event>
start-message / end-messageBroadcasted messages, supports {name}, {duration} and {next_duration}
blacklisted_generatorsGenerator ids that are not affected by the event
If you need any help please join our Discord Server.