I was playing around in the 24w14a snapshot, trying to make food heal instantly and have a stack size of 1, like in beta minecraft, and since turning natural regen off makes editing the saturation of a food useless for healing, I figured I'd add a potion effect to the food item, instant health, with various strengths to get different levels of healing.
However, the patch notes list:
effects: list of effects to apply when eaten (default: [])
effect: effect instance (same format as custom_effects in minecraft:potion_contents component)
probability: float between 0 and 1, chance for the effect to be applied (default: 1)
When I enter the command: /give RuskyPup minecraft:acacia_door[food={nutrition:5,saturation_modifier:1,can_always_eat:true,effects:[{effect:'minecraft:invisibility'}]}]
The command returns an error, stating: Malformed 'minecraft:food' component: 'Not a map:"minecraft:invisibility"'
The patch notes have no clear syntax regarding the usage of "effects" or "effect" and using either of them after nutrition+saturation_modifier with empty brackets returns a valid command!
I've visited the 24w09a patch notes regarding the changes to Potion_Contents, and the patch notes read as follows:
Format: object with fields
potion: potion id (optional)
The potion type in this item: the item will inherit all effects from this
custom_color: integer, RGB value (optional)
Overrides the visual color of the potion
custom_effects: list of effect instances (default: [])
Additional list of custom effects that this item should apply, that may not be representable by an existing potion
e.g. potion_contents={potion:'minecraft:invisibility',custom_color:16711680}
There isn't any clear syntax for the use of custom_effects in the example command, and attempting to run the command with the custom_effects tag (ex: potion_contents={potion:'minecraft:invisibility',custom_color:16711680,custom_effects:'minecraft:'poison'} same command with custom_effects added) returns an error!
Using numeric potion ids doesn't help either, and putting the example potion_contents string into the food={effect:[]} component returns a malformed 'minecraft:food' component: 'No key effect in MapLike[{potion"minecraft:effect"}]' error.
Pls help! command block beginner here, and I'm probably just stupid.
ok so i figured out how to do it; for example, getting a dirt block that gives nausea 1 for 15 seconds; give @p minecraft:dirt[minecraft:food={nutrition:1,saturation_modifier:1,can_always_eat:true,effects:[{effect:{id:"minecraft:nausea",amplifier:0,duration:300},probability:1}]}]
ok I am having a similar issue but with the Potions so far I have this: /give @p potion[minecraft:base_color=red,minecraft:item_name='[{"text":"Potion of Healing","color":"light_purple"}]',,minecraft:potion_contents={potion:'minecraft:strong_healing',custom_color:15408411,custom_effects:[]}] . I cant get any syntax to allow any additional effects within the custom effects section for a potion am I doing something wrong?
I was playing around in the 24w14a snapshot, trying to make food heal instantly and have a stack size of 1, like in beta minecraft, and since turning natural regen off makes editing the saturation of a food useless for healing, I figured I'd add a potion effect to the food item, instant health, with various strengths to get different levels of healing.
However, the patch notes list:
When I enter the command: /give RuskyPup minecraft:acacia_door[food={nutrition:5,saturation_modifier:1,can_always_eat:true,effects:[{effect:'minecraft:invisibility'}]}]
The command returns an error, stating: Malformed 'minecraft:food' component: 'Not a map:"minecraft:invisibility"'
The patch notes have no clear syntax regarding the usage of "effects" or "effect" and using either of them after nutrition+saturation_modifier with empty brackets returns a valid command!
I've visited the 24w09a patch notes regarding the changes to Potion_Contents, and the patch notes read as follows:
There isn't any clear syntax for the use of custom_effects in the example command, and attempting to run the command with the custom_effects tag (ex: potion_contents={potion:'minecraft:invisibility',custom_color:16711680,custom_effects:'minecraft:'poison'} same command with custom_effects added) returns an error!
Using numeric potion ids doesn't help either, and putting the example potion_contents string into the food={effect:[]} component returns a malformed 'minecraft:food' component: 'No key effect in MapLike[{potion"minecraft:effect"}]' error.
Pls help! command block beginner here, and I'm probably just stupid.
Thanks!
i literally have the exact same problem as you, and i can't find ANYTHING regarding this other than this forum post lol
ok so i figured out how to do it; for example, getting a dirt block that gives nausea 1 for 15 seconds; give @p minecraft:dirt[minecraft:food={nutrition:1,saturation_modifier:1,can_always_eat:true,effects:[{effect:{id:"minecraft:nausea",amplifier:0,duration:300},probability:1}]}]
oh, dope! you're a legend!
ok I am having a similar issue but with the Potions so far I have this: /give @p potion[minecraft:base_color=red,minecraft:item_name='[{"text":"Potion of Healing","color":"light_purple"}]',,minecraft:potion_contents={potion:'minecraft:strong_healing',custom_color:15408411,custom_effects:[]}] . I cant get any syntax to allow any additional effects within the custom effects section for a potion am I doing something wrong?