๐ŸŽ
Loots
Loots can be used to specify when to drop a particular item. You can decide to create different loot types:
  • blocks
  • mobs
  • fishing
For example this is the loots category of a .yml file I created.
1
loots:
2
blocks:
3
ruby_ore:
4
type: itemsadder:ruby_ore
5
items:
6
ruby:
7
item: itemsadder:ruby
8
min_amount: 1
9
max_amount: 2
10
chance: 100
11
nether_quartz_ore:
12
type: NETHER_QUARTZ_ORE
13
drop_only_first: true
14
items:
15
crystal:
16
item: itemsadder:crystal
17
min_amount: 1
18
max_amount: 2
19
chance: 10
20
knowledge_fragment:
21
item: itemsadder:knowledge_fragment
22
min_amount: 1
23
max_amount: 2
24
chance: 15
Copied!
This example has two loots in blocks category.
First one is called ruby_ore (you can call them as you prefer), this will drop a itemsadder:ruby item when you break a custom block of type itemsadder:ruby_ore with a minimum amount of 1 and maximum amount of 2 with 100% chance.
The second one is a loot from a vanilla block. As you imagine it will drop a crystal or a knowledge_fragment when the player breaks a NETHER_QUARTZ_ORE. These drops are decided by ItemsAdder based on chance you set.
Special property: drop_only_first This allows you to stop the plugin from dropping each of the items that succeed into extracting a correct chance to be dropped. WARNING: this would make your items harder to be dropped.

Drop only in specific biomes

1
loots:
2
blocks:
3
ruby_ore:
4
type: itemsadder:ruby_ore
5
biomes:
6
- PLAINS
7
- SUNFLOWER_PLAINS
8
- MOUNTAINS
9
items:
10
ruby:
11
item: itemsadder:ruby
12
min_amount: 1
13
max_amount: 2
14
chance: 100
Copied!

Ignore fortune enchant

You can make a loot ignore fortune enchant by adding the ignore_fortune property.
1
loots:
2
blocks:
3
ruby_ore:
4
type: itemsadder:ruby_ore
5
items:
6
ruby:
7
item: itemsadder:ruby
8
min_amount: 1
9
max_amount: 2
10
chance: 100
11
ignore_fortune: true # <----- here
Copied!

Other types of loots

As I said before there are other types of loots: mobs and fishing. These are some examples:

Fishing

1
loots:
2
fishing:
3
loot_blue_parrotfish:
4
biomes:
5
- WARM_OCEAN
6
items:
7
item_1:
8
item: itemsadder:blue_parrotfish
9
min_amount: 1
10
max_amount: 1
11
chance: 5
12
loot_green_sunfish:
13
items:
14
item_1:
15
item: itemsadder:green_sunfish
16
min_amount: 1
17
max_amount: 1
18
chance: 5
19
loot_goldfish:
20
items:
21
item_1:
22
item: itemsadder:goldfish
23
min_amount: 1
24
max_amount: 1
25
chance: 5
Copied!

Mobs

1
loots:
2
mobs:
3
villager:
4
type: VILLAGER
5
nbt:
6
profession:
7
path: VillagerData.profession
8
value: minecraft:farmer
9
type: string
10
items:
11
item_1:
12
item: itemsadder:straw_hat
13
min_amount: 1
14
max_amount: 1
15
chance: 100
16
ender_dragon:
17
type: ENDER_DRAGON
18
items:
19
item_1:
20
item: itemsadder:ender_dragon_wings
21
min_amount: 1
22
max_amount: 1
23
chance: 100
Copied!

Custom mobs loots (old entities method)

In order to let ItemsAdder drop an item based on when you kill a custom mob (created with ItemsAdder) you have to use the ItemsAdderMob metadata attribute. Example:
1
loots:
2
mobs:
3
soul:
4
type: HUSK
5
metadata:
6
ItemsAdderMob:
7
name: "ItemsAdderMob"
8
value: "creaturesplus:soul"
9
type: "string"
10
items:
11
ruby:
12
item: ruby
13
min_amount: 1
14
max_amount: 1
15
chance: 100
Copied!
As you can see I set ItemsAdderMob attribute and specified my custom mob namespace:id (in this example I used the creaturesplus:soul mob)

Custom entities loots

In order to let ItemsAdder drop an item based on when you kill a custom entity (created with ItemsAdder) you have to use the ItemsAdderEntity metadata attribute. Example:
1
loots:
2
mobs:
3
soul:
4
type: HUSK
5
metadata:
6
ItemsAdderEntity:
7
name: "ItemsAdderEntity"
8
value: "custom:ninja_skeleton"
9
type: "string"
10
items:
11
ruby:
12
item: ruby
13
min_amount: 1
14
max_amount: 1
15
chance: 100
Copied!
As you can see I set ItemsAdderEntity attribute and specified my custom mob namespace:id (in this example I used the custom:ninja_skeleton mob)

Villager professions (and any other NBT attribute you want to match)

1
loots:
2
mobs:
3
villager:
4
type: VILLAGER
5
nbt:
6
profession:
7
path: VillagerData.profession
8
value: minecraft:farmer
9
type: string
10
items:
11
item_1:
12
item: itemsadder:straw_hat
13
min_amount: 1
14
max_amount: 1
15
chance: 100
Copied!
As you can see I set profession attribute and specified the NBT attribute path, which in this case is VillagerData.profession. Then I set value to minecraft:farmer, this tells ItemsAdder to match only villagers with attribute VillagerData.profession set to minecraft:farmer.
The type attribute of nbt and metadata are really important, don't forget them or matches could not occur.

Drop based on Tile entity NBT data (for example Spawner)

1
loots:
2
blocks:
3
change_me:
4
enabled: true
5
type: SPAWNER
6
nbt:
7
spawner_type:
8
path: SpawnData.entity.id
9
value: minecraft:zombie
10
type: string
11
items:
12
change_me:
13
item: ACACIA_BOAT
14
min_amount: 1
15
max_amount: 1
16
chance: 100
17
ignore_fortune: false
Copied!
You have to enable this setting if you want to be able to get items from spawners by using an enchanted item with silktouch.
1
loots:
2
allow-loots-drop-from-spawners-using-silk-touch: true
Copied!