#(kristouffe) Components: Can we now make any item edible?
32 messages · Page 1 of 1 (latest)
(kristouffe) Components: Can we now make any item edible?
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@primal marten
what is component_patch supposed to be? so that i can understand?
Mojang restructured item data, and moved away from item NBT
It also adds some fancy stuff like making any item edible
This is also one of the reason plugins that tinker with items need more time to update than usual
Data components, or simply components, are structured data used to define and store various properties. They are used on items, where they are referred as item components or item stack components, and block entities, partially replacing NBT format.
Data components are used in various places, including the player's inventory, container block enti...
I think they're talking about #changelog message
Which, yeah technically that can be used for that until proper properties are added
But it's wont be as nice for script usage/fully supported across versions, see it's meta for more information
I should have been more cautious about the underscore
Aaah so how would you do that with the actual dev build if it's possible now ? That was my initial question 😅
You could try giving yourself an item with Minecraft commands and run /ex narrate <player.item_in_hand.components_patch>
You might be able to get the NBT Enconding format through that
Hmmm I think that will be a bit difficult to work with
the consumable map seems empty even if there are some things in it
What command did you use to make the item?
/give @a acacia_button[consumable={nutrition:2,saturation:4,can_always_eat:1b},max_stack_size=20]
btw components_patch and full_components_patch have the same output
Well, depends on the item - in this case all of these components are persisted via the components patch property, so they'll be the same yeah
Also I think that data is invalid? make sure the command is up-to-date, these components were changed a bit in 1.21.2/3
Something like
/give @p acacia_button[consumable={consume_seconds:3,animation:"spyglass",sound:"block.chain.break",has_consume_particles:true,on_consume_effects:[{type:"minecraft:play_sound",sound:"entity.enderman.teleport"}]}] 1
seems to work fine
yeah you're right, Food and Consumable are 2 different components now
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@primal marten