Skip to content

Loot Tables

Ryandw11 edited this page Dec 20, 2020 · 14 revisions

Everytime a structure is spawned the plugin will search for all the containers (chests, brewingstands, furnaces, ...) and fill them with the loottable content. Loottables can be configured using yaml files in the lootTables folder.

Creating a Loot Table

First open the CustomStructures folder. Inside it is a lootTables folder, open it. Inside is a file named lootTable.yml. Click on that file and press ctrl + c to copy the file. Then click on the background of the file explorer (unselect the file) and press ctrl + v to paste the file. You now have a template for your new lootTable.

Editing the Loot Table files.

#LootTable Example
#You can create as many files as you want, each file represents a loot table

#Determines how many Items will be chosen from the Items list bellow
Rolls:  3
Items:
  item0:
    #Item custom Name, you can use color codes (https://minecraft.tools/en/color-code.php)
    Name: '&1Test'
    #Material Type https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
    Type: 'IRON_SWORD'
    #Number of items per stack
    Amount: 1
    #Determines how often this entry will be chosen out of all the entries in the list.
    Weight: 10
    #List of Enchantments, one item can have multiple enchantments
    Enchantments:
      #Enchantment name and level
      LOOTING: 1
      SHARPNESS: 1
  item1:
    Name: '&2Test2'
    Type: 'IRON_HELMET'
    Amount: 1
    Weight: 5
  item2:
    Name: '&3Test3'
    Type: 'ROTTEN_FLESH'
    Amount: 5
    Weight: 20

Rolls

Rolls: 3

This determines how many Items will be chosen from the Items List.

Items

  item0:
    #Item custom Name, you can use color codes (https://minecraft.tools/en/color-code.php)
    Name: '&1Test'
    #Material Type https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
    Type: 'IRON_SWORD'
    #Number of items per stack
    Amount: 1
    #Determines how often this entry will be chosen out of all the entries in the list.
    Weight: 10
    #List of Enchantments, one item can have multiple enchantments
    Enchantments:
      #Enchantment name and level (https://hub.spigotmc.org/javadocs/spigot/org/bukkit/enchantments/Enchantment.html)
      LOOTING: 1
      SHARPNESS: 1

item0: - This is just any name for the item. (There can only be one with this name)
Name: '&1Test' - This is the name of the item.
Type: 'IRON_SWORD' - This is what item the item is.
Amount: 1 - Is the amount of items per stack.
Weight: 10 - Determines how often the item will be chosen out of all the items in the loottable. (Higher numbers mean higher chance)

Enchantments:
      #Enchantment name and level
      LOOTING: 1
      SHARPNESS: 1

This is what enchantments the item will have. Minecraft enchantment names are use here after version 1.5.4.1.

Adding Custom Items

See this page here!