Crop
Create a new yml file in the /contents/sprinklers directory to add a new sprinkler. Of course, you can also modify it based on default.yml.
Available event triggers for crop:
plant: When players plant the crop
reach_limit: When the amount of crops reached the limitation
break: When players break the crop
interact: When players interact the crop
wrong_pot: When players try planting the crop on the wrong pot
Available event triggers for each stage of crop:
interact: When players interact the certain crop stage
break: When players break the certain crop stage
grow: When the crop grows into a certain stage
# ID
tomato:
# Item type
# TRIPWIRE / ITEM_FRAME / ITEM_DISPLAY (1.19.4+)
type: TRIPWIRE
# The crop can only be planted on whitelisted pots
pot-whitelist:
- default
# Seed of the crop
seed: tomato_seeds
# Only works in ITEM_FRAME / ITEM_DISPLAY mode
random-rotation: true
# Break/Plant/Interact requirements
requirements:
interact: {}
break: {}
plant:
requirement_1:
type: season
value:
- Spring
- Autumn
not-met-actions:
message_action:
type: message
value: "It's not a good season to plant tomato"
# Event settings
events:
plant:
# Swing the main hand
swing_hand_action:
type: swing-hand
value: true
# Send sound while planting
sound_action:
type: sound
value:
source: player
key: minecraft:item.hoe.till
volume: 1
pitch: 1
break:
sound_action:
type: sound
value:
source: player
key: minecraft:block.crop.break
volume: 1
pitch: 1
# This determines the maximum time for crops to grow
max-points: 6
# This section determines the actions of crops at each point
points:
0:
# If model is set, the crop will replace its appearance when it reaches this stage.
model: tomato_stage_1
# Each crop has a different model height, so appropriate offsets should be made when displaying holograms.
hologram-offset-correction: 0.2
# Event settings
events:
break:
# 30% chance of dropping crop seeds
action_1:
type: drop-item
value:
ignore-fertilizer: true
item: tomato_seeds
min: 1
max: 1
chance: 0.3
1:
model: tomato_stage_2
hologram-offset-correction: 0.2
events:
break:
action_1:
type: drop-item
value:
ignore-fertilizer: true
item: tomato_seeds
min: 1
max: 1
chance: 0.5
3:
model: tomato_stage_3
hologram-offset-correction: 0.2
events:
break:
action_1:
type: drop-item
value:
ignore-fertilizer: true
item: tomato_seeds
min: 1
max: 1
chance: 0.7
5:
model: tomato_stage_4
hologram-offset-correction: 0.2
events:
interact:
action_1:
# An action that would only be triggered under certain conditions
type: conditional
value:
conditions:
requirement_1:
type: item-in-hand
value:
item: "AIR"
actions:
action_1:
# An action to remove the crop
type: break
# Whether to trigger the "break" event configured below
value: true
action_2:
type: swing-hand
value: true
action_3:
# Plant the crop again after removing
type: plant
value:
point: 0
crop: tomato
# grow event
grow:
action_1:
# An action type that changes crop into another block
type: variation
value:
golden:
item: tomato_stage_golden
type: TRIPWIRE
# The chance here is different from the external one
# This value would be affected by the fertilizers
chance: 0.01
chance: 1
break:
action_1:
type: drop-item
value:
ignore-fertilizer: true
item: tomato_seeds
min: 1
max: 2
chance: 1
# If you don't like quality crops, you can just use action "drop-item" instead
action_2:
type: quality-crops
value:
min: 1
max: 4
items:
1: tomato
2: tomato_silver_star
3: tomato_golden_star
6:
events:
grow:
action_1:
type: variation
value:
gigantic:
item: gigantic_tomato
type: CHORUS
chance: 0.02
# The crop would actually not gain so many points
# But you can set some special crops' loots here
99:
model: tomato_stage_golden
# You can set interact/break requirements for each stage
requirements:
interact: {}
break:
requirement_1:
type: item-in-hand
value:
item: GOLDEN_HOE
amount: 1
not-met-actions:
actionbar_action:
type: actionbar
value: "<red><bold>[X] Hold a golden hoe to harvest the golden tomato"
events:
break:
action_1:
type: drop-item
value:
ignore-fertilizer: true
item: tomato_seeds
min: 1
max: 2
chance: 1
action_2:
type: drop-item
value:
ignore-fertilizer: false
item: golden_tomato
min: 1
max: 4
chance: 1
action_3:
type: durability
value: -1
interact:
action_1:
type: conditional
value:
conditions:
requirement_1:
type: item-in-hand
value:
item: GOLDEN_HOE
amount: 1
actions:
action_1:
type: break
value: true
action_2:
type: swing-hand
value: true
action_3:
type: plant
value:
point: 0
crop: tomato
# Custom grow conditions
grow-conditions:
season_condition:
type: suitable_season
value:
- Spring
- Autumn
water_condition:
type: water_more_than
value: 0
# Custom death conditions
death-conditions:
no_water:
# You can customize the death stage models according to the reasons
model: crop_stage_death
conditions:
'&&':
condition_1:
type: water_less_than
value: 1
condition_2:
type: random
value: 0.7
unsuitable_season:
model: crop_stage_death
conditions:
condition_1:
type: unsuitable_season
value:
- Winter
crow_attack:
# Crop would be removed if "model" is not set
# model: crop_stage_death
conditions:
condition_1:
type: crow_attack
value:
chance: 0.005
fly-model: crow_fly
stand-model: crow_stand
# delay 150 ticks for the crop to be removed
delay: 150
# Custom bone meal
custom-bone-meal:
bone_meal_1:
item: BONE_MEAL
# Allow to be used with dispenser
dispenser: true
# Optional
item-amount: 1
# Optional
returm-item: xxx
# Optional
return-amount: 1
# Actions to run when using
actions:
swing_action:
type: swing-hand
value: true
particle_action:
type: particle
value:
particle: VILLAGER_HAPPY
x: 0.5
y: 0.5
z: 0.5
count: 5
offset-x: 0.3
offset-y: 0.3
offset-z: 0.3
sound_action:
type: sound
value:
source: player
key: minecraft:item.bone_meal.use
volume: 1
pitch: 1
chance:
2: 0.2
1: 0.6
Last updated