Class: ItemCompostableComponent
componentBeta
当存在此组件时,若堆肥概率处于 [1, 100] 区间内,该物品可以在堆肥桶中进行堆肥。
When present, the item can be composted in the composter block if the composting chance is in the range [1 - 100].
Extends
Properties
compostingChance
readonlycompostingChance:number
Beta
Remarks
该物品在堆肥桶中进行堆肥并产生堆肥层的百分比概率。注意,对于原版中可堆肥但并未使用该堆肥组件的物品,此 API 同样会返回其堆肥概率。
This is the percent chance of the item composting in the composter block and generating a compost layer. Note this api will also return the composting chance for vanilla items that are compostable but do not use the compostable item component.
Throws
Throws if value outside the range [1 - 100]
isValid
readonlyisValid:boolean
Beta
Remarks
返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。
Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component.
Inherited from
typeId
readonlytypeId:string
Beta
Remarks
组件的标识符。
Identifier of the component.
Inherited from
componentId
readonlystaticcomponentId:"minecraft:compostable"='minecraft:compostable'
Beta
