Skip to content

SpileComponent Class

The custom behavior for Wooden Spile

Parameters

NameTypeDefaultDescription
stateNameStringmorefood:sap_levelThe name of the sap level state
maxLevelNumber5The max sap level
bucketStringmorefood:maple_sap_bucketThe filled bucket item

Methods

onPlayerInteract

checkAxis

isAttachedToTree

onRandomTick

update

Example

js
new SpileComponent("sap_level", 5, "minecraft:milk_bucket");
json
{
  "format_version": "1.21.20",
  "minecraft:block": {
    "description": {
      "identifier": "wiki:custom_spile"
    },
    "component": {
      "minecraft:custom_components": ["morefood:spile"]
    }
  }
}

Not associated with or approved by Mojang Studios or Microsoft