BG-Software
Search…
Loot Tables
Loot tables are used to store all the loot data of entities. Using this system, the plugin can calculate drops for large amount of mobs.

Loot Tables

Every file is represented as a "loot table". Loot tables contain global settings and pairs. Pairs contain the items, and can be manipulated differently to get different results.

Example

1
{
2
# We don't want equipment to be dropped.
3
"dropEquipment": false,
4
# We want a random exp value between 5 and 8.
5
"exp":{
6
"min": 5,
7
"max": 8,
8
# Should exp be dropped no matter how the entity was killed?
9
"always-drop": true
10
},
11
# We want a maximum amount of 2 pairs, but at least 1 pair to be chosen.
12
"min": 1,
13
"max": 2,
14
# All the pairs of items are going here
15
"pairs": [
16
...
17
]
18
}
Copied!

Loot Pairs

Each loot-pair contains configuration about a group of items that will be dropped. When drops are calculated, the plugin chooses loot-pairs to drop, and then it chooses items from these loot-pairs, depend on the configuration of the loot-pairs.

Example

1
{
2
# All settings related to the table
3
...
4
"pairs": [
5
# First Pair
6
{
7
# This pair should always be chosen (100%)
8
"chance": 100,
9
# Chance is [base-chance] + ([looting-level] * [looting-chance])
10
"lootingChance": 2.5,
11
# A required permission for the pair to be chosen.
12
"permission": "my.permission",
13
# A list of items for this pair
14
"items": [
15
...
16
]
17
},
18
# Second Pair
19
{
20
# This pair will be chosen only if the entity was killed by a player.
21
"killedByPlayer": true,
22
# This pair will be chosen only 50% of the times.
23
"chance": 50,
24
# A required spawn cause for the entity so the pair will be chosen.
25
"spawn-cause": "SPAWNER",
26
# A list of items for this pair
27
"items": [
28
...
29
]
30
},
31
# Third Pair
32
{
33
# This pair will be chosen only if the entity was killed by an enderman.
34
"killer": [
35
"ENDERMAN"
36
],
37
# This pair will be chosen only 50% of the times.
38
"chance": 50,
39
# A list of commands for this pair
40
"commands:" [
41
...
42
]
43
}
44
]
45
}
Copied!

Loot Items

Each loot-item represents an item that can be dropped from a mob. It contains configuration about the item itself (its type, name, lore, etc), the amount of the item to be dropped, chance of the item to be dropped and more.

Example

1
{
2
# All settings related to the table
3
...
4
"pairs": [
5
{
6
# All settings related to the pair
7
...
8
"items": [
9
# First item
10
{
11
# The material type of the item
12
"type": "DIAMOND_SWORD",
13
# The data value of the item
14
"data": 0,
15
# A custom name for the item.
16
"name": "&6Diamond Sword!!",
17
# A custom lore for the item.
18
"lore": [
19
"&7First line!",
20
"&4Second line!"
21
],
22
# The chance of this item to be chosen.
23
"chance": 50,
24
# Minimum amount for the item
25
"min": 1,
26
# Maximun amount for the item
27
"max": 1,
28
# A list of enchantments that will be applied to the item.
29
"enchants":{
30
# First enchantment - Sharpness 5
31
"DAMAGE_ALL": 5,
32
# Second enchantment - Looting 3
33
"LOOT_BONUS_MOBS": 3
34
}
35
},
36
# Second item
37
{
38
# Values
39
...
40
# Should the item amount be increased when using looting?
41
# The formula to calculate the item amount is [random number between min and max] + [random number between 0 and the looting level]
42
"looting": true,
43
# The item will be glowing when dropped (no enchantments will be shown)
44
"glow": true,
45
# The item that will be dropped if the entity was killed by fire
46
"burnable:"{
47
"type": "COOKED_BEEF",
48
"data": 0
49
}
50
},
51
# Third item
52
{
53
"type": "PLAYER_HEAD",
54
# Values
55
...
56
# The texture value of the skull.
57
# These values can be taken from many sites, such as https://minecraft-heads.com/.
58
# The head below will be shown as an orc head.
59
"skull": "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODJkNmI2MjJmMDZkYmQzYjE5YmY3NjUzOGNhNzA0NzMzZWQwYjAyZTQ0MzhjOWQ4OTY4YTA0YmZiYjI4ZWY2MyJ9fX0=",
60
# It is possible to add custom nbt tags to your items.
61
"nbt-data": {
62
"key1": "Value!",
63
"key2": 2
64
}
65
}
66
]
67
}
68
]
69
}
Copied!

Loot Commands

Loot commands are similar to items, however instead of dropping an item, you can have a command executed when a mob is killed.

Example

1
{
2
# All settings related to the table
3
...
4
"pairs": [
5
{
6
# All settings related to the pair
7
...
8
"commands": [
9
# First command
10
{
11
# The chance of this command to be chosen
12
"chance": 50,
13
# Minimum amount for the placeholder
14
"min": 1,
15
# Maximun amount for the placeholder
16
"max": 1,
17
# A list of commands that will be ran
18
"commands":[
19
"give {player-name} diamond {number}",
20
"give {player-name} dirt {number}"
21
]
22
},
23
# Second command
24
{
25
# The chance of this command to be chosen
26
"chance": 50,
27
# Minimum amount for the placeholder
28
"min": 1,
29
# Maximun amount for the placeholder
30
"max": 64,
31
# A list of commands that will be ran
32
"commands":[
33
"give {player-name} emerald {number}"
34
]
35
}
36
]
37
}
38
]
39
}
Copied!
Last modified 1mo ago