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.

Turesso

Members
  • Joined

  • Last visited

Everything posted by Turesso

  1. I'm working on my first Minecraft mod, and I've created an item that requires a keybind to activate. However, currently, I need to press my assigned keybind and then hold down the default Minecraft keybind (right mouse button) for the item to function. How can I make it so that the item only requires my custom keybind to work? public InteractionResultHolder<ItemStack> use(Level pLevel, Player pPlayer, InteractionHand pHand) { ItemStack itemstack = pPlayer.getItemInHand(pHand); ItemStack offhandStack = pPlayer.getItemInHand(InteractionHand.OFF_HAND); if (!offhandStack.isEmpty()) { return InteractionResultHolder.fail(itemstack); } if (isCharged(itemstack)) { // Verifica se está usando a mão correta if (pHand == InteractionHand.MAIN_HAND) { performShooting(pLevel, pPlayer, pHand, itemstack, getShootingPower(itemstack), 0F); setCharged(itemstack, false); return InteractionResultHolder.consume(itemstack); } } else if (hasAmmo(pPlayer)) { if(KeyBindings.INSTANCE.examplekey.isDown()){ if (!isCharged(itemstack)) { if (pHand == InteractionHand.MAIN_HAND) { this.startSoundPlayed = false; pPlayer.startUsingItem(pHand); } } } return InteractionResultHolder.consume(itemstack); } else { pLevel.playSound((Player) null, pPlayer.getX(), pPlayer.getY(), pPlayer.getZ(), ModSounds.NOAMMO.get(), SoundSource.PLAYERS, 1.0F, 1.0F); return InteractionResultHolder.fail(itemstack); } return InteractionResultHolder.fail(itemstack); }

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.