#Removing item components

1 messages · Page 1 of 1 (latest)

oblique fiberBOT
next steeple
#

You can remove the component using data remove. If you want to do this for the player inventory. You have to move the item to a minecart, modify it and then move it back

covert ibex
#

i'd like to clarify, any method better than just rebuilding the item in a give command or inline loot table, or using an outside entity

desert nexus
#

technically !<component> is a removal

covert ibex
#

technically yes but it means the item can't stack with unmodified versions of itself

desert nexus
#

you mean the unmodified ones have said component?

covert ibex
#

no, they don't have the !component component

#

this disables components, it does not remove them

desert nexus
#

except you shouldn't see this on the item

#

unless the default is not empty

#

I don't know of any stackable items that have repair_cost by default however

#

the only method other than ! is to use /give and /clear or if it is outside of a player do data remove

#

alternatively, you can do a copy_components and exclude the repair_cost

#

you must also exclude custom_data because it will set a default empty object even if the original had none

#

e.g.:
{function:"minecraft:copy_components",source:"this",exclude:["minecraft:repair_cost","minecraft:custom_data"]}

#

this is an inline modifier

oblique fiberBOT
oblique fiberBOT