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'm creating a modifier system to tools, which I've mentioned a few times here, and I'm trying to edit some of these values. However, due to passing in an ItemStack, I cannot figure out how to cast it into the type of Item that I can modify. How would I go about modifying these values in my capability. One theory I've had is declaring those variables in the capability and then setting the defaults in the ItemClass, but I'm not 100% sure how to do that.

  • Author

If I was trying to change the efficiency of a tool, there is a base value in the Item class. for an individual ItemStack, what is the accepted way to edit the speed of a tool. I haven't been able to find any resources online

  • Author

I hadn't seen that comment, but where would I override those methods? Would I be declaring a new Instance of the item in the Capabilities class and then passing in the stack? 

  • Author

https://github.com/BURN447/DartcraftReloaded/blob/master/src/main/java/burn447/dartcraftReloaded/Items/Tools/ItemForcePickaxe.java

 

This is my Current tool class. I am overriding the methods, but when there is a specific tag, probably NBT, I'm trying to change the efficiency value. I'm also getting a stack using getStackInSlot, which gives me an itemstack, and if it belongs to my mod, it's supposed to add a modifier

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.