Spooky season is here. Happy Halloween from Lattice!
Lattice
Docs/LatCandyDrops

LatCandyDrops

Hostile mobs drop glowing candy only the killer can pick up, with a daily cap and rewards.

No reviews yet

Overview

Module id
candy-drops
Version
1.0.0
Platforms
paper
Price
$3.99
Authors
Atlantis Services

Install

  1. Install Lattice on a Paper or Folia server, if it is not there yet.
  2. Drop the LatCandyDrops jar into plugins/Lattice/modules/. It loads straight away.
  3. Put your license key in lattice.yml, then run /lat license refresh.
  4. Edit config/global/candy-drops/ and apply it with /lat reload candy-drops.

Commands

Command names and aliases are set in config.yml, so yours may differ. <required> [optional]

Command Description Permission
/candy
also /candies
The candy you have collected today candydrops.use

Permissions

Permission Lets a player use
candydrops.use
/candy

Placeholders

Filled in Lattice's own messages, and in any plugin that reads PlaceholderAPI when it is installed.

Placeholder Notes
%candydrops_collected%
%candydrops_left%
%candydrops_max%

config.yml

Written to config/global/candy-drops/config.yml on first start. Edit it, then /lat reload candy-drops.

# Candy drops: hostile mobs killed by a player drop a piece of candy only that player can pick up.
# Picking it up runs a reward. Each player can collect a capped number a day.

# Generated from CandyDropsSettings. Keys you delete return to their default;
# keys that are not in the schema are ignored and reported on load.

command:
  # Command for the candy collected today. Takes effect on restart.
  name: "candy"
  aliases:
    - "candies"
  permission: "candydrops.use"
# Timezone for start, end and the daily reset of the cap, e.g. Europe/London.
timezone: "UTC"
# First day, as MM-DD, repeating every year. Leave start and end empty to run all year.
# An end before the start runs over the new year.
start: "10-01"
# Last day, inclusive, as MM-DD.
end: "11-01"
# Worlds candy can drop in, by name. Empty for every world.
worlds: []
# Chance, from 0 to 1, that a kill drops a piece of candy.
drop-chance: 0.15
# Pieces of candy each player can collect per day. Past this, candy stops dropping for them.
max-per-day: 25
# Mobs that entered the world this way never drop candy, so spawners cannot be farmed.
# Names from Bukkit's CreatureSpawnEvent.SpawnReason, e.g. SPAWNER, SPAWNER_EGG, DISPENSE_EGG, TRAP.
ignored-spawn-reasons:
  - "SPAWNER"
  - "SPAWNER_EGG"
  - "DISPENSE_EGG"
# Candy kinds by id, picked by weight at drop time. The id is stored on the item.
candies:
  candy-corn:
    # Relative chance against the other kinds.
    weight: 55
    # Item the candy looks like on the ground.
    icon: "ORANGE_DYE"
    # Name floating over the candy, as MiniMessage.
    name: "<gold>Candy Corn"
    # What the player gets for picking it up.
    reward:
      # Console commands. {player} is the player's name.
      commands:
        - "minecraft:give {player} cookie 3"
      # Sent to the player as a success line in the server theme. Empty for none.
      message: "<body>Candy corn. Sweet and slightly suspicious."
      # Sound key, e.g. entity.player.levelup. Empty for none.
      sound: "entity.item.pickup"
  caramel-apple:
    # Relative chance against the other kinds.
    weight: 28
    # Item the candy looks like on the ground.
    icon: "APPLE"
    # Name floating over the candy, as MiniMessage.
    name: "<red>Caramel Apple"
    # What the player gets for picking it up.
    reward:
      # Console commands. {player} is the player's name.
      commands:
        - "minecraft:give {player} apple 2"
      # Sent to the player as a success line in the server theme. Empty for none.
      message: "<body>A sticky caramel apple!"
      # Sound key, e.g. entity.player.levelup. Empty for none.
      sound: "entity.item.pickup"
  chocolate-bar:
    # Relative chance against the other kinds.
    weight: 16
    # Item the candy looks like on the ground.
    icon: "COCOA_BEANS"
    # Name floating over the candy, as MiniMessage.
    name: "<#8b4513>Chocolate Bar"
    # What the player gets for picking it up.
    reward:
      # Console commands. {player} is the player's name.
      commands:
        - "minecraft:give {player} cake 1"
      # Sent to the player as a success line in the server theme. Empty for none.
      message: "<body>A whole chocolate bar. Treasure it."
      # Sound key, e.g. entity.player.levelup. Empty for none.
      sound: "entity.player.levelup"
  golden-wrapper:
    # Relative chance against the other kinds.
    weight: 1
    # Item the candy looks like on the ground.
    icon: "GOLD_NUGGET"
    # Name floating over the candy, as MiniMessage.
    name: "<gradient:#ff7a00:#b14cff><bold>Golden Wrapper</bold></gradient>"
    # What the player gets for picking it up.
    reward:
      # Console commands. {player} is the player's name.
      commands:
        - "minecraft:give {player} golden_apple 1"
      # Sent to the player as a success line in the server theme. Empty for none.
      message: "<accent>A golden wrapper! Someone is feeling generous."
      # Sound key, e.g. entity.player.levelup. Empty for none.
      sound: "ui.toast.challenge_complete"

Messages

Every line players see, in config/global/candy-drops/messages.yml. Uses MiniMessage formatting.

Show messages.yml (9 lines)
# Player-facing text for candy-drops.
# Placeholders in {braces} are filled in by the module.
# A key you delete falls back to its built-in default.

busy: Your candy is still being counted. Try again in a moment.
closed: Candy is not dropping right now.
full: You cannot carry any more candy today
players-only: Only a player can do that.
status: '<body>Candy collected today: <accent>{collected}</accent><muted>/</muted><accent>{max}</accent>'