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

Hey. Im working on a backpack. Its works, has 3d model when worn and all that stuff. The only thing i don't know how to deal with is inserting items on pickup. I already have an event handler set up with this event (which gives an achievement for now) but i dont know to inject items into it. As i said, i can detect when the player picks up items.

This is my current code:

 

@ForgeSubscribe

public void onItemPickup(EntityItemPickupEvent event){

if(event.item.getEntityItem().getItem() == Item.coal){

AchievementLoader.completeAchievement(event.entityPlayer, "firstStep");

 

if(event.entityPlayer.inventory.armorInventory[1].getItem() == ToolLoader.itemBackpack){

 

}

}

}

(You really whould tell me why i can't use the code button and all of those buttons at the top of the post :/ )

I try my best, so apologies if I said something obviously stupid!

You need to @Override the oldpickup

 

@Buttons

and the buttons are only decoration blocks

 

[.code][./code] for cookies without the . *i hope u get it*

*********************************

**  Always remember you are unique,  **

**  just like everyone else                   **     

**********************************

Was my post helpful? Say thanks and

press the thank you button, on my post!!

God, damn it!

  • Author

Buttons:

So, it's just BBCode (Which im aware of, since I also used to program websites)... well thanks for making me look stupid :)

 

About the code.. yeah but i need to know how to actually assign those items into my backpack's inventory (which is currently equipped on my back as a piece of armor).. because usually armors don't have an inventory :o

I try my best, so apologies if I said something obviously stupid!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.