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

So basically i made a Gun mod, but through A series of crashes i Lost the work thank god i had a compiled version on my drop box and have managed to decompile it.

So now i need help to finish it off so basically the problems when i try to reload i crash and on the screen says lost connection fatal error has occurred and when i shoot the gun takes bullets but does not damage the mob.

and here is all my code on github

https://github.com/britishcoding/gun-mod/tree/master/gun

Where are you setting the damage? Damage the entity in onImpact. For example, look at the EntitySnowball class. That should give you a rough idea.

If you read this, I'm hot.

  • Author

okay so i have narrowed it down to this being wrong

  if (player.inventory.func_146028_b(gun.getMagazineItem()))

        {

          nbt.setInteger("remainingAmmo", magazine.getMaxDamage());

          if (!player.capabilities.isCreativeMode) {

            player.inventory.func_146026_a(gun.getMagazineItem());

          }

        }

and i need to know what these are

146028_b

146028_a

Look at what you think the methods would do. Inside the 1st if-statement you set an integer to NBT, and do something when you are NOT in creative mode. You are working on a gun

Item

, and you have a variable called

magazine

. Now I guess that you check if you got a magazine in your inventory, set an integer to NBT and consume the Item when you are NOT in creative mode. Now looking at the

InventoryPlayer 

class, it has the methods

hasItem

and

consumeInventoryItem

. So

func_146028_bis 

hasItem

and

func_146026_a

is

consumeInventoryItem

.

 

So you see, with a little logic it's very easy to figure out the proper names (writing this took me longer than getting the proper names without an IDE).

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • 1 year later...
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.