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

Add verbosity and clarification to First Item tutorial page #161

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jwred5
Copy link

@jwred5 jwred5 commented Aug 11, 2024

No description provided.

Add more wording to fill in gaps in tutorial
@jwred5 jwred5 requested a review from a team as a code owner August 11, 2024 22:25
Copy link

netlify bot commented Aug 11, 2024

Deploy Preview for nimble-elf-d9d491 ready!

Name Link
🔨 Latest commit 739a0de
🔍 Latest deploy log https://app.netlify.com/sites/nimble-elf-d9d491/deploys/66b93a52e061d00008221774
😎 Deploy Preview https://deploy-preview-161--nimble-elf-d9d491.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Aug 11, 2024

Deploy Preview for nimble-elf-d9d491 ready!

Name Link
🔨 Latest commit 899c6bc
🔍 Latest deploy log https://app.netlify.com/sites/nimble-elf-d9d491/deploys/66e76571422d0d0008df20d2
😎 Deploy Preview https://deploy-preview-161--nimble-elf-d9d491.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.


To do this, you can add a public static initialize method to your class and call it from your `ModInitializer` class. Currently, this method doesn't need anything inside it.
ModItems.java
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to label these code blocks, use h4 headings.

@[code transcludeWith=:::1](@/reference/latest/src/main/java/com/example/docs/item/FabricDocsReferenceItems.java)

Calling a method on a class statically initializes it if it hasn't been previously loaded - this means that all `static` fields are evaluated. This is what this dummy `initialize` method is for.

With that added, running your mod will now allow you to /give yourself your {mod-id}:suspicious_substance.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap templates in `` please. Eg; {mod-id}: suspicious_substance.

You could alternatively have:

Once you've added this method, you can run your mod and use the following command to give you the suspicious substance item;

\`\`\`command
/give @s <mod-id>:suspicious_substance
\`\`\`

Make sure to replace \`<mod-id>\` with your mod's ID!

@[code transcludeWith=:::1](@/reference/latest/src/main/java/com/example/docs/item/FabricDocsReferenceItems.java)

Calling a method on a class statically initializes it if it hasn't been previously loaded - this means that all `static` fields are evaluated. This is what this dummy `initialize` method is for.

With that added, running your mod will now allow you to /give yourself your {mod-id}:suspicious_substance.

But it still won't show up when you press 'E', for that, you will need to register the item to an Item Group, described next.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be more specific;

It wont show up within the creative inventory...

Keybinds aren't fixed, especially vanilla ones like Open Inventory

@@ -36,18 +39,28 @@ If you want to change your item's stack size, you can use the `maxCount` method
This will not work if you've marked the item as damageable, as the stack size is always 1 for damageable items to prevent duplication exploits.
:::

For example, you can create a new "Suspicious Substance" by adding this static field to your ModItems class.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For example, you can create a new "Suspicious Substance" by adding this static field to your ModItems class.
In this example, we will create a "Suspicious Substance" item, by adding this static field to your `ModItems` class.

@IMB11 IMB11 added improvement A new addition to an already existing page stage:cleanup This should be cleaned up labels Aug 13, 2024
@jwred5 jwred5 requested a review from IMB11 September 15, 2024 22:54
@its-miroma its-miroma added stage:verification This should be verified and removed stage:cleanup This should be cleaned up labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement A new addition to an already existing page stage:verification This should be verified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants