Agricultural Harvest Action
Optimized action for harvesting crops in an AOE, replanting immediately, and merging drops.
Felder
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
radius | Int | 1 | Radius on the X and Z axis to harvest (e.g., 1 for a 3x3 area). Capped at 8 to keep one break cheap. |
autoReplant | Boolean | true | Should crops be automatically replanted (set age to 0)? |
particle | Particle | COMPOSTER | Particle shown over the harvested area. Particles that need extra data are ignored. |
particleCount | Int | 15 | How many particles are shown once per harvest. 0 disables them. |
sound | String | block.crop.break | Sound key played once per harvest (e.g. block.crop.break). Leave blank for no sound. |
soundVolume | Float | 1 | Volume of the sound. 0 is silent. |
soundPitch | Float | 1 | Pitch of the sound (1 is normal, lower is deeper). |
Gemeinsame TypeWriter-Felder (criteria, modifiers, triggers)
| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
criteria | List<Criteria> | empty | — |
modifiers | List<Modifier> | empty | — |
triggers | List<Ref<TriggerableEntry>> | empty | — |
When to use it
Put this entry in the actions of a mechanic of a Custom Enchantment Definition whose event is BLOCK_BREAK. The action reads the block-break event and harvests mature crops within radius blocks (at most 8), on the same level, around the broken block. The broken block itself follows the normal break. On any other event the action does nothing.
- Harvested crops drop their loot according to the tool in the main hand when the break happened; the drops are merged into a few stacks and dropped at the broken block, not given to the player.
- With
autoReplanton, each harvested crop goes back to age 0; otherwise it is removed. particle,particleCount,sound,soundVolumeandsoundPitchset the feedback, shown once per harvest.particleCount0 disables the particles and a blanksounddisables the sound. Particles that need extra data (such as a dust color) are ignored.