Skip to main content

Agricultural Harvest Action

Optimized action for harvesting crops in an AOE, replanting immediately, and merging drops.

Fields

FieldTypeDefaultDescription
radiusInt1Radius on the X and Z axis to harvest (e.g., 1 for a 3x3 area). Capped at 8 to keep one break cheap.
autoReplantBooleantrueShould crops be automatically replanted (set age to 0)?
particleParticleCOMPOSTERParticle shown over the harvested area. Particles that need extra data are ignored.
particleCountInt15How many particles are shown once per harvest. 0 disables them.
soundStringblock.crop.breakSound key played once per harvest (e.g. block.crop.break). Leave blank for no sound.
soundVolumeFloat1Volume of the sound. 0 is silent.
soundPitchFloat1Pitch of the sound (1 is normal, lower is deeper).
Common TypeWriter fields (criteria, modifiers, triggers)
FieldTypeDefaultDescription
criteriaList<Criteria>empty—
modifiersList<Modifier>empty—
triggersList<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 autoReplant on, each harvested crop goes back to age 0; otherwise it is removed.
  • particle, particleCount, sound, soundVolume and soundPitch set the feedback, shown once per harvest. particleCount 0 disables the particles and a blank sound disables the sound. Particles that need extra data (such as a dust color) are ignored.