Skip to content

AStages Crop Restriction

Kessy edited this page Jan 25, 2025 · 2 revisions

AStages Crop Restriction

Overview

Crop Restrictions controls the ability to grow of specific crops based on progression stages. This feature enables tailored farming mechanics, adding depth to resource management and gameplay progression.


Methods

Method Description Parameters Returns
AStages.addRestrictionForCrop(id, stage, cropBlock) Create and add generic crop restriction. id: arbitrary string used as identifier.
stage: progression stage.
cropBlock: block to be restricted.
ACropRestriction
AStages.addRestrictionForCrop(id, stage, cropBlock, compareCondition, age) Create and add more concisely crop restriction. id: arbitrary string used as identifier.
stage: progression stage.
cropBlock: block to be restricted.
compareCondition: condition to be applied for age checking.
age: age to be checked.
ACropRestriction

Examples

Tip

To define in a more precise way some restriction, you can use ACompareCondition enum provided by AStages to lock, for instance, the wheat only if its growth level is under 4. ACompareCondition could be: "equal", "less", "less_equal", "great", "great_equal".

Basic Usage

// Server Script Folder -> file.js (arbitrary file name).
AStages.addRestrictionForCrop("astages/crop1", "stage_crop", "minecraft:wheat")
AStages.addRestrictionForCrop("astages/crop2", "stage_crop", "minecraft:wheat", "less", 4)

Documentation:

  1. Home

  2. Stages
    - Usage
    - Utils

  3. Restrictions
    - Crop
    - Dimension
    - Effect
    - Enchant
    - Item (Old)
    - Loot
    - Mob
    - Ore
    - Pet
    - Recipe
    - Region
    - Screen
    - Structure

  4. Addons
    - Curios API
    - Pufferfish Skill's

  5. Simple Restrictions (via commands)
    Brand new and intuitive way to add restriction!

  6. Developers
    - Plugin
    - Restrictions
    - Simple Restrictions
    - Stage System
    - Utils

  7. Q&A
    A place where questions are on the agenda!

  8. Changelogs
    Changelogs since 0.6.0 version!

  9. Version Comparisons

  10. What's Happened? (FLOP!)
    New code formatting is coming!

Clone this wiki locally