- Now when player eats a food, it can be converted to another item.
Changes in food-components.yml
Code (YAML):
food
:
# The component called 'default' won't be registered, this is just for an example.
# Effects and conditions sections are optional.
'default':
item
: STICK
# If set, this item is considered as a food, and can be eaten.
components
:
# If nutrition or saturation is -1, we'll skip them, and they won't have any effect when eaten.
# The number of food points restored by this item when eaten. Must be a non-negative integer.
nutrition
: 3
# The amount of saturation restored by this item when eaten.
saturation
: 1
# If true, this item can be eaten even if the player is not hungry. Defaults to false.
can-always-eat
: true
# The number of seconds taken by this item to be eaten. Defaults to 1.6.
eat-seconds
: 1.2
# A list of effects applied by this item when eaten.
effects:
'1'
:
# The namespaced key of the potion effect type.
name
: REGENERATION
# The amplifier of the effect, with level I having value 0. Optional, defaults to 0.
amplifier
: 0
# The duration of the effect in ticks. Values 0 or lower are treated as 1. Optional, and defaults to 1 tick.
duration
: 100
# Whether this is an effect provided by a beacon and therefore should be less intrusive on the screen. Optional, defaults to false.
ambient
: false
# Whether this effect produces particles. Optional, defaults to true.
show-particles
: true
# Whether an icon should be shown for this effect. Defaults to true.
show-icon
: true
# The chance for the effect to be applied. Must be a positive float between 0 and 1. Defaults to 1.
probability
: 1
conditions
:
# Should we check if the item's name is the same as the value below?
# Leave it skip-check, if you do not want to check for item's name.
name
:
""
# Should we check if the item's lore is the same as the value below?
lore
:
[
]
# Should we check if the item's amount is the same as the value below?
# Leave it -1 for any amount.
amount
: -1
# Should we check if the item's name is the same as the value below?
# Provide enchantments' names in the list that you want the same in item.
# ENCHANTMENT_NAME:ENCHANTMENT_LEVEL
enchantments
:
[
]
# When player eats this food, should we convert it to another item? (optional)
converts-to
:
# The material of the item that will be converted.
material
:
""
# The display name of the item that will be converted.
name
:
""
# The lore of the item that will be converted.
lore
:
[
]
# The amount of the item that will be converted.
amount
: 1