đĄ Range Dispatch
Introdcutionâ
Render an item model based on numeric property. Will select last entry with threshold less or equal to property value.
When using minecraft:range_dispatch, you need to specify the numeric property type. scale represents the factor to multiply the property value with, entries represent the models under different numerical values, and fallback represents the item model object if no valid entry was found. It is optional, but if not specified, it will render a missing error model.
items:
default:range_dispatch_item:
model:
type: "minecraft:range_dispatch"
property: "minecraft:crossbow/pull"
entries:
- model:
type: minecraft:model
path: "minecraft:item/custom/model_1"
threshold: 0.58
- model:
type: minecraft:model
path: "minecraft:item/custom/model_2"
threshold: 1.0
fallback:
type: minecraft:model
path: "minecraft:item/custom/model_3"
Propertiesâ
Check https://minecraft.wiki/w/Items_model_definition#range_dispatch for the explanation of each argument.
minecraft:crossbow/pullâ
Return crossbow-specific use time.
minecraft:bundle/fullnessâ
Return weight of
minecraft:bundle_contentscomponent or0if not present.
minecraft:cooldownâ
Return remaining cooldown for item, scaled between
0.0to1.0.
minecraft:compassâ
Return an angle, scaled from
0.0to1.0in x-z plane between holder position and target. If target is not valid (not present, in other dimension or too close to holder position) random value will be returned.
type: "minecraft:range_dispatch"
property: "minecraft:compass"
target: spawn
wobble: true
minecraft:countâ
Return stack size.
type: "minecraft:range_dispatch"
property: "minecraft:count"
normalize: true
minecraft:damageâ
Return value for
minecraft:damagecomponent or0if not present.
type: "minecraft:range_dispatch"
property: "minecraft:damage"
normalize: true
minecraft:timeâ
Return value of a in-game time, scaled betewen
0.0to1.0.
type: "minecraft:range_dispatch"
property: "minecraft:time"
source: daytime
wobble: true
minecraft:use_cycleâ
Return remaining use ticks modulo
period.
type: "minecraft:range_dispatch"
property: "minecraft:use_cycle"
period: 1.0
minecraft:use_durationâ
Return item use ticks.
type: "minecraft:range_dispatch"
property: "minecraft:use_duration"
remaining: false
minecraft:custom_model_dataâ
Return value from
floatslist inminecraft:custom_model_datacomponent or0if not present.
type: "minecraft:range_dispatch"
property: "minecraft:custom_model_data"
index: 0