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

In my mod, I have mana implemented. . However, you can gain 50 mana by right clicking on a bed. I have a weapon that, when you right click, consumes 50 mana and spawns EntityLargeFireball. If your mana is less than 50, then a line of text appears in chat. However, for some reason you are able to spawn multiple Fireballs when you shouldn't be able to. For example, if i had 150 mana, I should be able to spawn 3 fireballs, but instead it spawns anywhere from 3 to maybe 8. Once mana reaches 0, the text appears as it should. However, once mana goes back up, the fireball doesn't spawn and the text still occurs. Here is the code that is in the weapon. Can anyone help?

______________________________________________________________________________________________________________________________________________________________________________________

@Override
    public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn)
      { 
        if(playerIn.hasCapability(ManaProvider.MANA_CAP, null))
        {
            if(playerIn.getCapability(ManaProvider.MANA_CAP, null).consume(50f))
            {
                playerIn.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 5, 1000));
                Minecraft.getMinecraft().world.spawnEntity(new EntityLargeFireball(Minecraft.getMinecraft().world, playerIn.posX, playerIn.posY, playerIn.posZ, 3d, 0d, 3d));
                 
            }
            else
            {
                playerIn.sendMessage(new TextComponentString("FUCK YOU, DIP DIP"));
            }
        }

_____________________________________________________________________________________________________________________________________________________________________________________

1.12 is no longer supported on this forum.

Please update to a modern version of Minecraft to receive support.

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

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.