#Where am I goofing up here?

1 messages · Page 1 of 1 (latest)

north smeltBOT
#
How To Ask Good Questions

Be specific and include relevant details about the question upfront.

  • What are you trying to accomplish?
  • If you have code, which part is not working?
  • What have you already tried?
  • Have you searched the Bedrock Wiki?

https://xyproblem.info/

gray bolt
#

Let me preface this with saying I really didn't want to ask for help. But I've tried everything, and I am out of ideas and getting pissed off.
I frequent wiki.bedrock.dev/guide .... I use the links in blockbench to examine the code for items between versions. //learn.microsoft.com/en-us/minecraft/creator/documents . I downloaded the examples/samples pack on the bedrock dev wiki (which seems a little out of date btw). I even downloaded similar addons, to try and reference how other people are doing it, but I can't seem to find any of recent versions of the game. And I am trying to something incredibly simple, so where am I fucking up in this code?

{
"format_version": "1.20.30",
"minecraft:item": {
"description": {
"identifier": "ve:chocolate_bar",
"menu_category": {
"category": "equipment",
"group": "itemGroup.name.miscFood"
}
},
"components": {
"minecraft:use_modifiers": {
"use_duration": 1.0,
"movement_modifier": 0.35
},
"minecraft:max_stack_size": 64,
"minecraft:icon": {
"texture": "chocolate_bar"
},
"minecraft:food": {
"nutrition": 4,
"saturation_modifier": 1,
"can_always_eat": true,
"effects": [
{
"name": "speed",
"chance": 1.0,
"duration": 300,
"amplifier": 0
}
]
},
"minecraft:use_animation": "eat"
}
}
}

#

current issue I am having is that the food is not actually being eaten, and no effect is applying.

long musk
#

You can't apply effect in current version with food component. The only way is to set you item format version to
"format_version": "1.10"
If you do that, the effect will be applied but the item icon will be not shown as now items require this component:
"minecraft:icon": { "texture": "cabbage" },
and if you put this component in version 1.10 your item will simply not work(does nothing when interact with it)
I have the same problem with some of my custom foods, as both effects or even event will be soon deprecated or are not working. I have seen multiple posts about this here.

gray bolt
gray bolt
gray bolt
# long musk You can't apply effect in current version with food component. The only way is t...

{
"format_version": "1.17.0",
"minecraft:item": {
"description": {
"identifier": "c:mint_cookie",
"category": "equipment"
},
"components": {
"minecraft:icon": {
"texture": "mint_cookie"
},
"minecraft:display_name": {
"value": "Mint Cookie \n§7Speed IV (0:05) \n§6Nutrition Level: \n§7Four \n§6Saturation Level: \n§7Normal \n§2Agriculture's Fantasy"
},
"minecraft:creative_category": {
"parent": "itemGroup.name.miscFood"
},
"minecraft:use_duration": 1.6,
"minecraft:use_animation": "eat",
"minecraft:food": {
"nutrition": 4,
"saturation_modifier": "normal",
"can_always_eat": true,
"on_consume": {
"target": "self",
"event": "eventeffect"
}
}
},
"events": {
"eventeffect": {
"add_mob_effect": {
"target": "self",
"effect": "speed",
"duration": 5,
"amplifier": 3
}
}
}
}
}

gray bolt
#

current rough idea.

#

{
"format_version": "1.20.30",
"minecraft:item": {
"description": {
"identifier": "ve:chocolate_bar",
"menu_category": {
"category": "equipment",
"group": "itemGroup.name.miscFood"
}
},
"components": {
"minecraft:use_modifiers": {
"use_duration": 1.0,
"movement_modifier": 0.35
},
"minecraft:use_animation": "eat",
"minecraft:max_stack_size": 64,
"minecraft:icon": {
"texture": "chocolate_bar"
},
"minecraft:food": {
"nutrition": 4,
"saturation_modifier": 1,
"can_always_eat": true
},
"minecraft:on_use": {
"event": "atefood"
},
"events": {
"atefood": {
"minecraft:mob_effect": {
"mob_effect": "speed"
}
}
}
}
}

gray bolt
dusty patio
#

{
"format_version": "1.10",
"minecraft:item": {
"description": {
"identifier": "xtra:cheese"
},
"components": {
"minecraft:hand_equipped": false,
"minecraft:stacked_by_data": true,
"minecraft:foil": false,
"minecraft:max_stack_size": 64,
"minecraft:use_duration": 32,
"minecraft:food": {
"nutrition": 4,
"saturation_modifier": "normal",
"can_always_eat": false,
"effects": [
{
"name": "resistance",
"chance": 1.0,
"duration": 10,
"amplifier": 1
}
]
}
}
}
}

#

use this