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

Hello, I have been working on making an item for a mod in Forge. Most of the resources I could find use PlayerEntity.setActiveHand, but that no longer seems to exist, and I can't seem to find an equivalent method in PlayerEntity. My code is below in case it helps, though it's not particularly specific.
 

    @Override
    public ActionResult<ItemStack> use(World worldIn, PlayerEntity playerIn, Hand hand) {

        ItemStack mainHandItem = playerIn.getMainHandItem();
		
      	// cannot resolve method
        playerIn.SetActiveHand(hand);

        return new ActionResult<ItemStack>(ActionResultType.SUCCESS, mainHandItem);

 

general advice: hit ctrl+space after the dot (before the method name). you get a list of methods. how many take a single argument of type Hand and return nothing?

 

i'm guessing you're using old game version so we likely won't help you more.

  • Author

Thanks for the help - I was able to get it going with your advice.

In case any fellow 1.16.5 users see this, the following method was the replacement.

PlayerEntity.startUsingItem();

I really appreciate the kind response, despite the version no longer being supported!

Guest
This topic is now closed to further replies.

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.