SimpleCrates

SimpleCrates v1.0.2

Compatible API Versions
1.0.8
Contributors
Ceremonious
SimpleCrates.png
SimpleCrates is my first Nukkit plugin ever created! It is roughly based off of Crates Reloaded for Minecraft Java Edition. A plugin for easy rewards by clicking a block with a key to win items!

How to make a crate:
  1. Type /crates create <crate>
  2. Look at the block you want to set as the crate
  3. Type /crates setblock <crate>
  4. You can then add items/commands to the crate!
  5. You can also set keys to be an item or virtual!
Note: Commands on crates always run, Use reward commands for commands that won't always run. Check the config spoiler for more information.

How item chances work:

The chance system is based on weights. While the config states that it is a chance, this is misleading and actually represents a
weight. For this example, we will choose convenient numbers where the summation adds up to 100.

Let's say we had 5 items or commands with the following chances:
  1. 50
  2. 20
  3. 15
  4. 10
  5. 5
Each reward is calculated to a percentage based on its weight.
  • The total weight is 100 = (50 + 20 + 15 + 10 + 5).
  • Reward Percentage = (weight / total weight) * 100%.
Note: The total does not have to add up to 100.

Planned features:
  • Custom UI on Click
  • Custom Items for Keys ✓ (v0.9.7)
  • Holographic Nameplates
  • % Chances on items ✓ (v0.9.7)
Known Bugs (Intended to be fixed by v1.0):
  • FIXED - Error when first loading plugin (/reload/restart the server to fix) (v1.0)
  • FIXED - Items with certain meta data get stuck in Inventory (v0.9.8)
  • FIXED - Delete command not deleting from config file
  • FIXED - Adding crates with commands adds weird characters into config file
Please report any bugs you find to me! I can't fix things if I don't know they're broken! The best way to contact me is through the NukkitX Discord.

permission: crates.keys
  • /keys - Displays how many virtual keys a player has
permission: crates.admin
  • /crates read - Displays information for the item (in your hand) for easy configuring
  • /crates list - List current crates
  • /crates create <crate> - Create a crate
  • /crates delete <crate> - Delete a crate
  • /crates setblock <crate> - Set the crate block (It will pick the block you're looking at)
  • /crates additem <crate> - Add an item to the crate
  • /crates addcmd <crate> <command> - Add a reward command to the crate
  • /crates removecmd <crate> <command> - Remove a reward command from a crate
  • /crates addplayercmd <crate> <command> - Add a reward player command to the crate
  • /crates removeplayercmd <crate> <command> - Remove a reward player command from a crate
  • /crates givekey <player> <crate> <amount> - Give a crate key to a player
  • /crates givekeyall <crate> <amount> - Give keys to every player on the server

version: 1.0 #used for safety checks for plugin updates
options: #plugin options
prefix: '&f[&e&lSC&r&f]&f' #prefix shown in chatcrates: #crates​
default: #crate name​
displayname: '&e&lSimple Crate' #crate displayname​
rounds: 1 #amount of rewards per crate click​
key:​
virtual: false #sets if crate keys are virtual​
id: 131 #key item id​
durability: 0 #key item durability​
name: '{displayname} Key' #key displayname (use {displayname} for crate displayname. ex: &e&lSimple Crate)​
lore: '&eUse on the {name} crate!' #key lore (use {name} for crate name. ex: default)​
enchantments: #key enchantments​
'17': 3 #enchantment id, level​

commands: #crate commands that are ALWAYS ran​
console: #console commands​
- give {user} diamond 1​
- tell {user} Thanks for downloading SimpleCrates!​
player: #player commands​
- me is awesome for running this plugin!​

rewards: #crate rewards​
items: #reward items​
enchantedglass: #item identifier​
id: 20 #item id​
durability: 0 #item durability, ex: 35:3​
chance: 100 #item chance​
name: '&r&bEnchanted Glass' #item name​
lore: #item lore​
- Very special indeed!​
amount: 16 #amount of items you get at once​
enchantments: #enchantments (user /crates read command for information)​
'0': 0 #enchantment id, level​
'5': 2​

stone-1:​
id: 1​
durability: 0​
chance: 100​
name: 'null' #set to 'null' if item does not have custom name​
amount: 16​


commands: #reward commands​
console: #reward console commands​
give {user} cookie 1: #command​
chance: 20 #chance​


player: #reward player commands​
me I'm epic for using this plugin!: #command​
chance: 20 #chance​
  • Like
Reactions: kocalin
Author
Ceremonious
Downloads
3,044
Views
3,908
First release
Last update
Rating
4.31 star(s) 13 ratings

More resources from Ceremonious

Latest updates

  1. v1.0.2

    Bug Fixes: Fixed addcmd, removecmd, addplayercmd and removeplayercmd commands
  2. v1.0.1

    Bug Fixes: Fixed items not working after getting them from a crate (blocks not placing, etc)
  3. v1.0

    New Features: Removed 50% chance between if a reward is an item or command (They are all now in...

Latest reviews

Good plugin, all works well pls add mysql then i give 5 stars
Add a new update which will add particles around the crates please, with it there'll be no longer anything I could ask for.
Der setblock command spinnt etwas aber sonst ok. Wenn dieser Fehler behoben wird gibt es 5 sterne
It is even possible to use different crates (filled with different Items) with one type of Key
I started 3 crates, named "Material" , "MaterialHOLZ" and "MaterialSTEIN".
Put different types of wood, leaves and saplings in the "MaterialHOLZ".
Put diferrent types of stone (from fw, nether and end) in the "MaterialSTEIN".
and changed in the 'config.yml' the Key to "Material" at the two other crates.

A nice way to let the player decide, what he needs more.
[Sorry, german thoughts in english words]
The /crate addcmd - addcmdplayer commands do not work
Ceremonious
Ceremonious
Fixed in version 1.0.2
Still cant figure out how to get the shop to give a key to the players. Im using trading interface. you add items based on item ID. Is there a way to maybe have a second shop that uses commands?
Nice, but needs more active development.
Bug when reloging having the key, makes the key unusable.
Now you've fix that problem, you deserve your 5 stars =D
This plugin is excellent ! But there is a way to remove the spam when you don't have the key ?
Ceremonious
Ceremonious
Fixed in version 1.0
Top