#Removing item components
1 messages · Page 1 of 1 (latest)
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
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
technically !<component> is a removal
technically yes but it means the item can't stack with unmodified versions of itself
you mean the unmodified ones have said component?
no, they don't have the !component component
this disables components, it does not remove them
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