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.

SaemonMoki

Members
  • Joined

  • Last visited

  1. Hey everyone! I've come across an interesting use case of the custom items I am creating for my mod. The item is simple, and has no real complicated code. All I need, is each instance of the item to have a special array of different values sent for it to store given to it by what creates it. Below are code snippets showing the default implementation. The names have been generalized for easy of readability. ObjectHolder: The item class: Registry: Renderer: Entity that 'spawns'/drops the item Now obviously the main issues, is that the item instantiated in MobItems, is the one and only instance, so obviously whenever I try to call the "setDifferences" method, it overrides what is in use. I can very easily circumvent this, by creating a new instance of the object(using the same registry names) when the entity calls "dropItem", passing it through the new item that I have called setDifferences. This works. However the result is obviously an object that is a purpleblack box because the renderer doesn't have THAT specific object registered. So my question is how can I possible have the spawning of new items done in a fashion were I can treat them all as their own individual objects and set their own variables? If anyone has some ideas or possibly even separate implementations, I'm all ears. :)

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.