Skip to content
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

Open
wants to merge 2 commits into
base: wiki
Choose a base branch
from
Open

Conversation

KawEduh-dv
Copy link

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
my_custom_food

adding the file where the food code with effects is
adding the image used in the tutorial to represent the item
Copy link
Collaborator

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).
Copy link
Collaborator

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"
Copy link
Collaborator

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",
Copy link
Collaborator

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">
Copy link
Collaborator

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 = {
Copy link
Collaborator

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

Suggested change
const itemOnConsumeComponent = {
const ItemFoodEffectsComponent = {

Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants