Decoration Behaviours
Example of some behaviours for decorations:
id: mynamespace:clown_horn
vanillaItem: minecraft:paper
itemResource:
models:
default: mynamespace:custom/misc/clown_horn
behaviour:
animation:
model: mynamespace:mymodel
autoplay: myAnimationName
container:
name: Example Container
size: 9
purge: false
openAnimation: openAnimation
closeAnimation: closeAnimation
lock:
key: minecraft:tripwire_hook
consumeKey: false
discard: false
unlockAnimation: unlockAnimation
command: "say Unlocked"
seat:
- offset: [0.0, 0.0, 0.0]
direction: 0.0
showcase:
- offset: [0.0, 0.0, 0.0]
scale: [1.0, 1.0, 1.0]
rotation: [0.0, 0.0, 0.0, 1.0]
type: item
filterItems: null
filterTags: null
cosmetic:
slot: head
model: mynamespace:clown_backpack_animated
autoplay: idle
scale: [1.5, 1.5, 1.5]
translation: [0.0, 0.5, 0.0]
{
"id": "mynamespace:clown_horn",
"vanillaItem": "minecraft:paper",
"itemResource": {
"models": {
"default": "mynamespace:custom/misc/clown_horn"
}
},
"behaviour": {
"animation": {
"model": "mynamespace:mymodel",
"autoplay": "myAnimationName"
},
"container": {
"name": "Example Container",
"size": 9,
"purge": false,
"openAnimation": "openAnimation",
"closeAnimation": "closeAnimation"
},
"lock": {
"key": "minecraft:tripwire_hook",
"consumeKey": false,
"discard": false,
"unlockAnimation": "unlockAnimation",
"command": "say Unlocked"
},
"seat": [
{
"offset": [0.0, 0.0, 0.0],
"direction": 0.0
}
],
"showcase": [
{
"offset": [0.0, 0.0, 0.0],
"scale": [1.0, 1.0, 1.0],
"rotation": [0.0, 0.0, 0.0, 1.0],
"type": "item",
"filterItems": null,
"filterTags": null
}
],
"cosmetic": {
"slot": "head",
"model": "mynamespace:clown_backpack_animated",
"autoplay": "idle",
"scale": [1.5, 1.5, 1.5],
"translation": [0.0, 0.5, 0.0]
}
}
}
Behaviours
animation behaviour
Defines an animation behaviour for decorations. Supports ajmodel/bbmodels.
Models are placed in data/mynamespace/filament/model/mymodel.bbmodel.
You would reference it as mynamespace:mymodel in the model field.
model: The name of the animated model associated with this animation (if applicable).autoplay: The name of the animation to autoplay (if specified).variant: The model variant to display (for Animated-Java models). Can be mapped to a block-state
animation:
model: mynamespace:mymodel
autoplay: myAnimationName
{
"animation": {
"model": "mynamespace:mymodel",
"autoplay": "myAnimationName"
}
}
container behaviour
Defines a container behaviour for decorations.
Allows to create barrels, trashcans, etc.
Works with the animation behaviour to play an animation defined in the bbmodel/ajblueprint.
Supports copper golem item transport based on block-tags: c:chests/wooden and minecraft:copper_chests
name: The default name displayed in the container UI. Empty by defaulttitlePrefix: Prefix for the title, can be used for custom backgrounds for example. Empty by defaultshowCustomName: Flag whether to show the name of the placed itemstack. Enabled by default.size: The size of the container, has to be 5 slots or a multiple of 9, up to 6 rows of 9 slots.purge: Indicates whether the container's contents should be cleared when no player is viewing the inventory.openAnimation: The name of the animation to play when the container is opened (if applicable).closeAnimation: The name of the animation to play when the container is closed (if applicable).canPickup: Flag whether the container will not drop its items when broken but store it as component in the dropped itemhopperDropperSupport: Flag whether hoppers/droppers can interact with this containerangerPiglins: Flag whether opening the container will anger piglins. Enabled by default.
container:
name: Example Container
size: 9
purge: false
openAnimation: openAnimation
closeAnimation: closeAnimation
{
"container": {
"name": "Example Container",
"size": 9,
"purge": false,
"openAnimation": "openAnimation",
"closeAnimation": "closeAnimation"
}
}
animated_chest behaviour
Allows to make animated connectable containers with a left and right side.
Requires with the animation behaviour to play an animation defined in the bbmodel/ajblueprint.
Supports copper golem item transport based on block-tags: c:chests/wooden and minecraft:copper_chests
name: The default name displayed in the container UI.showCustomName: Flag whether to show the name of the placed itemstack if it has a custom name. Enabled by default.size: The size of the container, has to be 5 slots or a multiple of 9, up to 6 rows of 9 slots.purge: Indicates whether the container's contents should be cleared when no player is viewing the inventory.openAnimation: The name of the animation to play when the container is opened (if applicable).closeAnimation: The name of the animation to play when the container is closed (if applicable).canPickup: Flag whether the container will not drop its items when broken but store it as component in the dropped itemhopperDropperSupport: Flag whether hoppers/droppers can interact with this containerangerPiglins: Flag whether opening the container will anger piglins. Enabled by default.ignoreBlock: Flag whether the block in direction as specified inblockDirectionprevents the chest from being opened. Enabled by defaultblockDirection: Direction for theignoreBlockcheck. Can beup,down,north,east,south,west.upby default.
animated_chest:
name: Example Chest
size: 27
openAnimation: openAnimation
closeAnimation: closeAnimation
{
"animated_chest": {
"name": "Example Chest",
"size": 27,
"openAnimation": "openAnimation",
"closeAnimation": "closeAnimation"
}
}
lock behaviour
This behaviour runs a command, optionally with a key item.
It's similar to the execute item-behaviour or interact_execute decoration behaviour.
The command will only run once if a key is specified, the key can be empty to always run the commands/animations on
interaction.
The repeatable flag can be set to overwrite this.
The command or commands are run as player but with elevated permissions, optionally at the decoration block itself.
key: The identifier of the key required to unlock. Optional, if left empty the unlockAnimation will play (if applicable) and the commands will be run and the decoration will be discarded based on thediscardflag.consumeKey: Determines whether the key should be consumed upon unlocking.discard: Specifies whether the decoration should be destroyed after interacting with it.unlockAnimation: Name of the animation to play upon successful unlocking with a key (if applicable).command: Command to execute when the lock is successfully unlocked (if specified).commands: List of commands to execute when the lock is successfully unlocked (if specified).atBlock: false/true flag whether the command should be run at the blocks' positionconsole: Run as server/console instead of as player
interact_execute behaviour
This behaviour runs a command, plays an animation and runs a command once the animation finished.
It behaves similar to the lock behaviour, but will always
It's similar to the execute item-behaviour or interact_execute decoration behaviour.
The command will only run once if a key is specified, the key can be empty to always run the commands/animations on
interaction.
The repeatable flag can be set to overwrite this.
The command or commands are run as player but with elevated permissions, optionally at the decoration block itself.
key: The identifier of the item held by player required to run commands/animations. Optional, if left empty the animation will play (if applicable) and the commands will be run and the decoration will be discarded based on thediscardflag.consumeKey: Determines whether the key should be consumed upon unlocking. Defaults tofalsedamageKey: Determines whether the key should be damaged upon unlocking. Defaults tofalseanimate_per_player: Flag to play animations per-player. Defaults tofalsediscard: Specifies whether the decoration should be destroyed after interacting with it. Defaults tofalseanimation: Name of the animation to play when interacting.animationPost: Name of animation to player after the first one endedcommand: Command to execute when the lock is successfully unlocked (if a key is specified, otherwise the command is always run).commands: List of commands, as aboveatBlock: false/true flag whether the command should be run at the blocks' positioncommandPostAnimation: Command to run when the first animation stops playingcommandsPostAnimation: List of commands, as abovecommandIncorrectKey: Command to run when the player has an incorrect keycommandsIncorrectKey: List of commands, as aboveanimationIncorrectKey: Animation to play when the player has an incorrect keyconsole: Run as server/console instead of as player
break_execute behaviour
This behaviour runs a command when the decoration is broken by a player
command: Command to execute when the lock is successfully unlocked (if specified).commands: List of commands to execute when interacted withatBlock: false/true flag whether the command should be run at the blocks' positionconsole: Run as server/console instead of as player
seat behaviour
Defines a seating behaviour for decorations.
For chairs, benches, etc.
offset: The player seating offset.direction: The rotation offset of the seat in degrees. Defaults to180
seat:
- offset: [0.0, 0.0, 0.0]
direction: 0.0
{
"seat": [
{
"offset": [0.0, 0.0, 0.0],
"direction": 0.0
}
]
}
showcase behaviour
Defines a showcase behaviour for decorations.
Allows you to create shelves / item-frame like decorations.
Can be either a list of elements or an object as described below:
Supports copper golem item transport based on block-tags: c:chests/wooden and minecraft:copper_chests
useMenu: Use a container menu instead of the in-world insert interactionname: The default name displayed in the container UI.canPickup: Flag whether the container will not drop its items when broken but store it as component in the dropped itemshowCustomName: Show the name of the itemstack inside the container menu. Defaults totruehopperDropperSupport: Enables hopper and dropper interaction. Defaults totrueelements: List of elements
offset: Offset for positioning the showcased item.scale: Scale of the showcased item.rotation: Rotation of the showcased item.type: Display entity type to use,blockfor block display,itemfor item display,dynamicuses block displays if possible, otherwise item displays.filterItems: Items to allow.filterTags: Items with given item tags to allow.addItemSound: Sound to use when inserting an item by a player. Defaults to item frame soundsremoveItemSound: Sound to use when an item is removed by a player. Defaults to item frame soundsmaxStackSize: Max stack size for this showcase element. Defaults to 1
sign behaviour
Allows you to create signs with multiple text displays.
Can be either a list of elements or an object as described below:
canEdit: Flag wether the sign elements can be edited. Defaults totruewaxable: Flag wether the sign is waxable. Defaults totruedyeable: Flag wether the sign is dyeable. Defaults totrueblock: Sign block to use for the Sign Edit GUI. Defaults tominecraft:oak_signelements: List of elements. See below
offset: Offset for positioning the text element. Defaults to[0, 0, 0.5]scale: Scale of the text element. Defaults to[0.5, 0.5, 0.5]rotation: Rotation of the showcased item.lines: Number of lines for this sign element. Defaults to4text: List of predefined lines of text for this sign element.billboardMode: Billboard mode of this element. Can befixed,vertical,horizontal,center. Defaults tofixedbackgroundColor: Background color of the text element. Defaults to0seeThrough: See-through flag. Defaults tofalsealignment: Text alignment. Can becenter,left,right. Defaults tocenter
sign:
can_edit: true
elements:
- offset:
- 0
- 0
- -0.51
rotation:
- 0
- 180
- 0
text:
- "<rainbow>Color test 2</rainbow>"
- "Very cool!"
- "this is the backside"
- ""
- offset:
- 0
- 0
- -0.55
text:
- "<rainbow>Color test 1</rainbow>"
- "Very cool!"
- "this is the front side"
- ""
{
"sign":{
"can_edit":true,
"elements":[
{
"offset":[
0,
0,
-0.51
],
"rotation":[
0,
180,
0
],
"text":[
"<rainbow>Color test 2</rainbow>",
"Very cool!",
"this is the backside",
""
]
},
{
"offset":[
0,
0,
-0.55
],
"text":[
"<rainbow>Color test 1</rainbow>",
"Very cool!",
"this is the front side",
""
]
}
]
}
}