-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom food with effects #1004
base: wiki
Are you sure you want to change the base?
Custom food with effects #1004
Conversation
adding the file where the food code with effects is
adding the image used in the tutorial to represent the item
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe simply calling the page "Custom Food" with a section called "Adding Consumption Effects" would be better? This way the page could be updated to include other additional functionality like cooking.
Page URL should not include underscores.
license: true | ||
mentions: | ||
- KawEduh-dv | ||
description: Learn now how to create customized shirts that, when eaten, gain one or more effects(such as the golden apple). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shirts?
"format_version": "1.21.60", | ||
"minecraft:item": { | ||
"description": { | ||
"identifier": "wiki:my_custom_food" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other pages on the wiki simply have the identifier wiki:custom_<thing>
, without the my_
.
//custom component with consume component | ||
"minecraft:custom_components": ["wiki:on_consume"], | ||
//food icon | ||
"minecraft:icon": "my_custom_food_texture", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should match the namespaced texture shortnames on the rest of the wiki: wiki:custom_food
.
} | ||
``` | ||
|
||
<Button link="https://raw.githubusercontent.com/Bedrock-OSS/bedrock-wiki/wiki/docs/public/assets/images/tutorials/custom-food_with_effects/my_custom_food.png"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link should go to the image hosted on the wiki, not GitHub: "/assets/images/tutorials/custom-food_with_effects/my_custom_food.png"
```js | ||
import { world } from "@minecraft/server"; | ||
|
||
const itemOnConsumeComponent = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Components should have specific names and not be named after events they listen to (on consume).
The variable name should match our style guide
const itemOnConsumeComponent = { | |
const ItemFoodEffectsComponent = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be in the assets/images/items
folder rather than assets/images/tutorials
tutorial teaching how to make a food that when eaten the player receives effects like the golden apple
wiki_custom_food_with_effects.zip

custom-food_with_effects.md
item_texture.json
my_custom_food.json