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

when ever i try to see a specifc item is in hand it dosent work...

ive given up hope on this... maybe someone else can see what i did wrong..

 

the part that needs to find the specifc item is line 19 (tried every way i could think of and got various NPE's and found waldo..)

 

 

http://pastebin.com/9Qdj9cB9

 

what i have that half works

Hi

 

I don't really understand your question.

 

Could you describe in a bit more detail what you want to happen? 

eg "When you hit a cow while holding a butcher's cleaver it should drop a steak"

 

-TGG

You'd need access to entityPlayer, and use

 

EntityPlayer.getCurrentItemOrArmor(0) == <YOURIDHERE>

ItemStack itemstack = new ItemStack(IntegratedItems.meatcleaver, 1, OreDictionary.WILDCARD_VALUE);
                        System.out.println("ItemStack found");
                        if(itemstack != null)
                        {
                                System.out.println("Itemstack is not null!");
                                if(event.entityLiving.getHeldItem().itemID == itemstack.itemID && event.entityLiving.getHeldItem() != null)

itemstack is not null. You just set it.

Conditions are checked in the order they are given.

  • Author

For anyone else who wants to do it.. here's how its done, although its not guaranteed to work if you try to make this event make one mob drop more than one item.

 

http://pastebin.com/K5sHCzU3

 

 

just swap out my items for yours, and my mobs for yours

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.