Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I was wondering if there was a way to make item ids stay what you.

 

	//Certus Ingot
public final static Item certusOrb = new CertusOrb(6101);
int certusOrbID = certusIngot.itemID;

 

In this item, I set the id to "6101".

In game, it switches around.

Is there anyway to fix this?

 

-Phase

 

1) You should ALWAYS grab the ID from the item/block instance DO NOT cache it. That's just asking for trouble.

2) It's setting it to 6357 as items are shifted by 256. There is nothing to fix, this is how minecraft works.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

  • Author

1) You should ALWAYS grab the ID from the item/block instance DO NOT cache it. That's just asking for trouble.

2) It's setting it to 6357 as items are shifted by 256. There is nothing to fix, this is how minecraft works.

 

What do you mean by "You should ALWAYS grab the ID from the item/block instance"?

int certusOrbID = certusIngot.itemID;

Don't do that, ALWAYS use certusIngot.itemID ALWAYS. It is better to centralize the id to one single place.

So that if it DOES ever change you dont have to find all the p[lace where you have 'magic numbers' and fix them.

Seriously, like 100 hunks in Forge are simply changing Mojang's hardcode of 'air' from 0 to something less magic number.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

  • Author

int certusOrbID = certusIngot.itemID;

Don't do that, ALWAYS use certusIngot.itemID ALWAYS. It is better to centralize the id to one single place.

So that if it DOES ever change you dont have to find all the p[lace where you have 'magic numbers' and fix them.

Seriously, like 100 hunks in Forge are simply changing Mojang's hardcode of 'air' from 0 to something less magic number.

 

Where do you put

int certusOrbID = certusOrb.itemID;

?

 

And I meant to put "certusOrb.itemID;"

not certusIngot.

 

 

 

 

Where do you put

int certusOrbID = certusOrb.itemID;

?

You don't Do NOT store item ids like that.

Anyways, not here to tech coding. There is no bugs or anything here.

So, end of thread. Please learn the structure of minecraft.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.