Jump to content

Recommended Posts

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!

Posted

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!

Posted

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.