-
Notifications
You must be signed in to change notification settings - Fork 15
Items
Items determine what things will drop from the loot tables, though it is not limited to only item drops. Each type of item has its own special kind of syntax and parameters and will be listed below.
This is probably the most common type of item that you will be wanting to drop: actual items! Making basic items is very simple, but you can do way more than that. Below is the most simple example of how to drop an item.
type: ENTITY
overwrite-existing: items
conditions:
- 'entity-type:villager'
pools:
0:
conditions: []
entries:
0:
conditions: []
items:
0:
type: item
item: emerald
amount: 1
Items have so many settings that they are going to be put onto a separate page which can be found here.
Support for dropping items from custom item plugins can be found here.
It is possible to drop a random item from a specific tag group. A list of possible tags can be found here.
type: ENTITY
overwrite-existing: items
conditions:
- 'entity-type:villager'
pools:
0:
conditions: []
entries:
0:
conditions: []
items:
0:
type: tag
tag: creeper_music_disc_drops
amount: 1
Tags support the same parameters as Items.
If an entity is capable of holding equipment or has an inventory, you can use this to drop those items. All armor chance parameters are optional and will default to their normal drop chances if not provided. drop-inventory
will default to false if not provided.
type: ENTITY
overwrite-existing: items
conditions:
- 'entity-type:skeleton'
pools:
0:
conditions: []
entries:
0:
conditions: []
items:
0:
type: entity_equipment
helmet-drop-chance: 0.15
chestplate-drop-chance: 0.07
leggings-drop-chance: 0.1
boots-drop-chance: 0.12
main-hand-drop-chance: 0.16
off-hand-drop-chance: 0.11
drop-inventory: false
Just as it says in the name, this will allow you to drop experience. You can optionally drop bonus experience based on how much equipment the mob that was killed has. To do this, create an equipment-bonus
section with a numerical value of how much experience to add per piece of equipment.
type: ENTITY
overwrite-existing: experience
conditions:
- 'entity-type:skeleton'
pools:
0:
conditions: []
entries:
0:
conditions: []
items:
0:
type: experience
amount: 5
equipment-bonus:
min: 1
max: 3
You can run commands for those more exotic actions you want to perform from loot tables.
type: ENTITY
overwrite-existing: none
conditions:
- 'entity-type:villager'
pools:
0:
conditions: []
entries:
0:
conditions: []
items:
0:
type: command
value: 'say %player% killed a villager at %x% %y% %z% in %world%!'
You can find valid placeholders to be used within commands on the Context Placeholders page.
Yes, it is possible to run a loot table within another loot table. If you're interested, the vanilla loot table for fishing uses nested loot tables like this. You can find the vanilla loot table in RoseLoot's format in the default examples.
type: ENTITY
conditions:
- 'entity-type:villager'
pools:
0:
conditions: []
entries:
0:
conditions: []
items:
0:
type: loot_table
value: 'fishing/treasure'
Want to have some fun? Cause an explosion! You can configure the explosion power and whether or not the explosion damages blocks or creates fire. The fire
and break-blocks
parameters are optional and will default to false
and true
respectively, while power
indicates the strength of the explosion.
type: ENTITY
overwrite-existing: none
conditions:
- 'entity-type:villager'
pools:
0:
conditions: []
entries:
0:
conditions: []
items:
0:
type: explosion
power: 5
fire: false
break-blocks: true
Notify players of special loot being generated! This item type is capable of playing sounds of any volume, pitch, category, and can even play custom sounds from resource packs! You can find a list of valid sound values here. volume
and pitch
will default to 1
, category
will default to master
(values can be found here), and player-only
will default to true
if not provided.
type: ENTITY
overwrite-existing: none
conditions:
- 'entity-type:villager'
pools:
0:
conditions: []
entries:
0:
conditions: []
items:
0:
type: sound
sound: 'entity.firework_rocket.twinkle'
volume: 1.0
pitch: 1.0
player-only: true
Want to reward players with money for killing mobs or mining blocks? Supported economy types are currently vault
, treasury
, playerpoints
, and tokenmanager
. If you would like direct support for another economy plugin, please request it in our Discord server.
type: ENTITY
overwrite-existing: none
conditions:
- 'entity-type:villager'
pools:
0:
conditions: []
entries:
0:
conditions: []
items:
0:
type: economy
economy: vault
amount: 12.5
It is possible to send messages to the player that caused the loot to be generated. Chat message types include chat_raw
, chat
, hotbar
, title
, and subtitle
. The title
and subtitle
types can have 3 optional numerical values (measured in ticks) which all have defaults if not provided. fade-in
defaults to 20, duration
defaults to 60, and fade-out
defaults to 20. Examples of all message types can be found below.
type: LOOT_TABLE
conditions: []
pools:
0:
conditions: []
rolls: 1
bonus-rolls: 0
entries:
0:
items:
0:
type: message
message-type: chat_raw
value: '{"text":"Sample chat_raw message","color":"yellow"}'
1:
type: message
message-type: chat
value: '<r:0.5>Sample chat message. Hello %player%!'
2:
type: message
message-type: hotbar
value: '<r:0.5>Sample hotbar message'
3:
type: message
message-type: title
value: '<r:0.5>Sample title message'
fade-in: 20
duration: 60
fade-out: 20
4:
type: message
message-type: subtitle
value: '<r:0.5>Sample subtitle message'
fade-in: 20
duration: 60
fade-out: 20