Skip to content

Getting Started

DreamDevs edited this page Jul 5, 2023 · 3 revisions

Getting Started with RandomLootChest

This tutorial will show you how to configure, operate and move in RandomLootChest! Do I need something to start server without getting any error? No! RandomLootChest is independent plugin, you only need this plugin, put this in your plugins directory and start your server! Let's start with tutorial!

Preparing and installing RandomLootChest

To install and run RandomLootChest properly, we need Spigot server at least. Let's install RandomLootChest plugin on server!

There we go! All configuration files have loaded properly! Let's check RandomLootChest directory...

We should have 2 directories and 4 yml files in our RandomLootChest directory and they're here!

Configuration files

All information about settings you'll find on Wiki section Configuration Files. But if we change something in configuration files and we don't have time to restart server, etc., we can just do pretty simple thing from console:

Adding, configuring chests!

There we go, It's time to add and configure chests! Let's find what we have by default. One chest that is an example for you, but let's create new one.

I created and configured new chest which has 4 items - one from items.yml and other 3 from Contents section. Now, we have to check if it is working. If we want to check how many chests we have on server, just use command /randomlootchest chests.

Okay, so now if we know that there are now 2 chests, let's place one chest. We need to place chest block anywhere, use /randomlootchest wand, left click on placed chest and select chest. After that, you should get this message:

If you want remove chest, just right click on placed chest with Chest Wand and that's all!

MMOItems in chests

There is no much to say, because if you want to put items from MMOItems to chests, follow below example:

Contents-MMOItems:
# PATTERN: TYPE:ITEM_ID:CHANCE
- AXE:SILVER_AXE:0.4

That's all you should know starting with RandomLootChest!

Creating Items in chest file!

After basics you should know, It's time to create some items to our chest! Let's find what we can put into items:

  • Material - it is type material, for example STONE; all materials you'll find here (IT IS MUST HAVE)
  • Amount - it is integer type, it must be positive integer, for example 4 (IT IS MUST HAVE)
  • Chance - it is float number, from 0 to 1, which represents percentage of chance, for example 0.4 = 40%, 0.25 = 25%, etc. (IT IS MUST HAVE)
  • DisplayName - it's display name of item, you can use minecraft colour codes or hex colours!
  • DisplayLore - list of strings represented as item's lore, also you can use colour codes or hex colours!
  • Enchantments - from 1.7.0 it is configuration section (in older versions, it is list), which contains all enchantments you want to add to the items, all enchantments you'll find here
  • Unbreakable - item is unbreakable or is not - true or false
  • Glowing - item will be glowing or won't be - true or false

Let's create basic item

Contents:
  item-id:
    Material: STONE_SWORD
    Amount: 1
    Chance: 0.5
    DisplayName: '&3Stone Sword'
    DisplayLore:
    - ''
    - '&7This is not typical stone sword.'
    - '&cCUSTOM LORE! You can try on newer versions (1.16+ with hex colours!)'

As you see, this is stone sword, with dark aqua display name, custom lore and we have 50% chance to get this sword. Let's create more items in this chest.

Contents:
  sword1:
    Material: WOODEN_SWORD
    Amount: 1
    Chance: 0.7
    DisplayName: '&aWooden Knife'
    DisplayLore:
    - ''
    - '&7Nobody uses it'
  sword2:
    Material: STONE_SWORD
    Amount: 1
    Chance: 0.6
    DisplayName: '&bWoo!'
    DisplayLore:
    - ''
    - '&7It is somehow useful...'
    Enchantments:
      DAMAGE_ALL: 1
      DURABILITY: 1
  coin:
    Material: SUNFLOWER
    Amount: 3
    Chance: 0.6
    DisplayName: '&bCoin'
    DisplayLore:
    - ''
    - '&6Just the coin'
    Glowing: true
  powerfulbow:
    Material: BOW
    Amount: 1
    Chance: 0.2
    DisplayName: '&c&lPOWERFUL BOW'
    DisplayLore:
    - '&4&lPOWER!!!'
    Unbreakable: true
    Enchantments:
      ARROW_DAMAGE: 10

There we go! All items MUST contain Material and Chance, everything else isn't necessary to use.

Let's create potion item

Yes, we can add potions to the chests! All you have to do is remember these attributes:

  • PotionEffect - it is potion effect type, for example SPEED; all potion types you'll find here
  • Extended - it is boolean type, it must be true or false; it represents if duration has to be extended or not
  • Upgraded - it is boolean type, it must be true or false; it represents if potion has to be upgraded (tier II) or not
Contents:
  potion:
    Material: POTION
    Amount: 1
    Chance: 0.7
    DisplayName: '&3Magic Potion'
    DisplayLore:
    - ''
    - '&7This is not typical stone sword.'
    - '&cCUSTOM LORE! You can try on newer versions (1.16+ with hex colours!)'
    PotionType: SPEED
    Extended: true
    Upgraded: false

Clone this wiki locally