editor
editor copied to clipboard
TemplateContext.player.create() does not work in custom item components
Summary
Within custom item components' template function, is a template context parameter. This parameter has a player
property that allows you to modify the player definition files. However it's create()
method does not work.
To Reproduce Steps to reproduce the behavior:
- Create a new project. Be sure to enable Holiday Creator Features, and include
player.json
. - Create a new item. You can use the Blank Item preset.
- Create a new custom item component.
- Add this code to the component file.
export default defineComponent(({ name, template, schema }) => {
name('test:test_component')
schema({})
template((_, { player }) => {
player.create({
'tag:you_should_see_this': {}
}, 'minecraft:entity/components')
})
})
- Add
test:test_component
to the custom item. - Forcefully Save everything (including the player.json to be sure)
- View the compiler output for
player.json
Observed behavior
Nothing about player.json
has changed in the output.
Expected behavior
After every existing component (in this case below minecraft:environment_sensor
) the component tag:you_should_see_this
should appear.
Platform:
- OS: Windows 11
- App Version: v2.2.13
Additional context
I haven't tested the other methods of TemplateContext.player
, but I'd assume they wouldn't work. Someone would need to confirm this.
Update on this: It seems like the player context functions, so animationController
, animation
and create
are all broken.
The content that should be in the player file end up in the item file for animationController
and animation