#Nullify effect given of a consumable
25 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
??kjswiki
You can modify various properties of an existing item with KubeJS, and the wiki has a page on it!
ItemEvents.modification(event => {
event.modify('minecraft:diamond', item => {
item.foodProperties = food => {
food.hunger(2)
food.saturation(3)
food.fastToEat(true)
food.eaten(e => e.player.tell('you ate')) // this is broken, use ItemEvents.foodEaten instead.
}
})
event.modify('pumpkin_pie', item => {
item.foodProperties = null // make pumpkin pies inedible
})
})``` you can run an event to clear the effect when you eat it in the item modification startup event
But if I'd have regeneration previously, it would remove it
you might be able to check for the exact duration and level of the effect, and only remove it if it matches exactly, still an edge case, but it is an extreme edge case, you would have to eat it at the exact right tick
that might require a delay, or just strictly not be possible for whatever reason
hmm
try overriding it with regeneration 1 for 0/1 ticks
i know if you modify the effect given to the food it disables the other effects it usually gives, for example i modified panthalassa's fish meat to give potion effects where it gave you hunger before
i didnt have to remove it or anything
there is
is that what they want or am i misunderstanding
though like kokoroto said if he has regeneration beforehand
ohh
try this js event.modify('modid:itemid', item => { item.foodProperties = food => { food .effect('minecraft:strength', 1, 0, 0) } }); that last 0 in 1, 0, 0 is the probability of getting the potion effect so setting it to 0 wil obviously make sure you never get it, if that doesnt work then try setting it to 1 and change the 1 at the start to a 0, thats the duration
should overwrite the effect
Not at home rn, will try tonight (9h aprox), but thanks n_n