Watering-can

/CustomCrops/contents/watering-cans/__WATERING-CAN__.yml

Let take watering_can_1 as an example to configure the watering can settings

Unique Identifier for Your Watering Can: Start by naming your watering-can under a unique identifier like watering_can_1. This makes it easy to reference and customize later on.

Assign a Unique Identifier: Begin by setting a unique item identifier for your watering can using ItemsAdder or Oraxen. For instance, watering_can_1 uniquely identifies this particular can, allowing it to be easily referenced throughout your game.

# Unique item identifier for ItemsAdder/Oraxen
item: watering_can_1

Customize the Watering Can's Appearance: You have the option to customize how the watering can looks at different water levels. Uncomment the appearance section and assign CustomModelData values to visually differentiate between an empty, partially filled, or fully filled watering can. This is a great way to add visual feedback for players on the can's status.

# Optional appearance settings for watering cans based on water capacity
# Uncomment and customize CustomModelData if you want different appearances for different water levels
#appearance:
#  0: 1000 # CustomModelData for empty can
#  1: 1001 # CustomModelData for partially filled can
#  2: 1002 # CustomModelData for more filled can
#  3: 1003 # CustomModelData for fully filled can

Set the Water Capacity: Define the maximum amount of water your watering can hold with the capacity parameter. Here, it is set to 3, meaning the can can store up to three units of water at a time. This capacity controls how long the can can be used before needing a refill.

# Maximum amount of water the watering can can store
capacity: 3

Determine Water Usage per Use: The water parameter specifies the amount of water dispensed each time the can is used. Setting this to 1 means that each use of the watering can will consume one unit of water and add 1 unit of water to the pot.

# Amount of water added to pot
water: 1

Define the Effective Watering Range: Customize how far the water reaches when used by setting the effective-range parameters. Width and length define a rectangular area around the player where the water will be effective, in this case, a 1x1 area directly in front of the player.

# The effective range of the watering can when used
effective-range:
  width: 1  # The width of the area affected
  length: 1 # The length of the area affected

Set Refill Methods: Define how players can refill the watering can by configuring the fill-method. In method_1, the player can refill the can by interacting with a WATER block (like a water source or well). The amount specifies that each interaction adds 1 unit of water to the can. This feature allows you to create interactive water sources throughout your game world.

fill-method:
  # Custom refill method configuration
  method_1:
    target: WATER  # The block or object that provides water (e.g., minecraft:block_id)
    amount: 1      # Amount of water added per refill

Specify Compatible Planting Pots: Use the pot-whitelist to specify which types of planting pots the watering can will work with. By listing default, you ensure that the can is compatible with the basic pot type, but you could add more pot types for variety.

# Specify which types of planting pots the watering can can be used with
pot-whitelist:
  - default  # Default pot type allowed

Allow Interaction with Sprinklers: If you want your watering can to be used for filling up sprinklers, list the compatible sprinkler IDs under sprinkler-whitelist. In this configuration, the can can fill sprinkler_1, sprinkler_2, and sprinkler_3, extending its functionality.

# Allow the watering can to fill compatible sprinklers
sprinkler-whitelist:
  - sprinkler_1
  - sprinkler_2
  - sprinkler_3

Enable Dynamic Descriptions: Dynamic lore adds a layer of immersion by displaying real-time information about the can's status. By enabling dynamic-lore, the description will change based on the water level. Use placeholders like {water_bar} to visually represent the water level, {current} for the current water amount, and {storage} for maximum capacity. This ensures players always know the state of their watering can at a glance.

# Dynamic lore settings for the watering can's description
dynamic-lore:
  enable: true  # Enable or disable dynamic lore based on water level
  # Lore text that will be displayed dynamically
  # Available placeholders:
  # {water_bar}: Visual representation of water level
  # {current}: Current amount of water
  # {storage}: Maximum water storage capacity
  lore:
    - '<italic:false><white><font:customcrops:default>{water_bar}</font>'
    - '<italic:false><gray>Right-click on water to refill the watering can.'

Customize the Water Level Display Bar: The water-bar configuration allows you to create a unique visual indicator for the water level using custom characters. This display provides a quick and visually appealing way to check how much water is left in the can.

# Configuration for the water level display bar
water-bar:
  left: '뀂'   # Left cap of the water bar
  full: '뀁뀃' # Segment representing full water level
  empty: '뀁뀄' # Segment representing empty water level
  right: '뀁뀅' # Right cap of the water bar

Set Up Events: The events section is where the real magic happens. Here, you define how the game responds to different interactions with the watering can. Available events: full/add_water/no_water/consume_water/wrong_pot/wrong_sprinkler

# Event settings to handle various actions with the watering can
events:
  # Event triggered when there's no water left in the watering can
  no_water:
    sound_action:
      type: sound
      value:
        key: "minecraft:item.bundle.insert"  # Sound to play
        source: 'player'                     # Sound source
        volume: 1
        pitch: 1
    actionbar_action:
      type: actionbar
      value: '<red><bold>[X] Water has been used out'  # Message displayed on action bar
  # Event triggered when water is consumed from the watering can
  consume_water:
    sound_action:
      type: sound
      value:
        key: "minecraft:block.water.ambient"  # Sound of water being consumed
        source: 'player'
        volume: 1
        pitch: 1
    actionbar_action:
      type: actionbar
      value: '<font:customcrops:default>{water_bar}</font>' # Display updated water bar
  # Event triggered when water is added to the watering can
  add_water:
    particle_action:
      type: particle
      value:
        particle: WATER_SPLASH  # Particle effect for adding water
        x: 0.5
        y: 1.3
        z: 0.5
        count: 5
    sound_action:
      type: sound
      value:
        key: "minecraft:item.bucket.empty"  # Sound to play when filling the can
        source: 'player'
        volume: 1
        pitch: 1
    actionbar_action:
      type: actionbar
      value: '<font:customcrops:default>{water_bar}</font>' # Update water bar display

Set Up Requirements: Under requirements, you can configure the conditions player have to meet before using the watering-can.

requirements:
  requirement_1:
    type: permission
    value: xxx.xxx

Last updated