Jump to content

Recommended Posts

Posted

Alright, so for the past few hours I tried many different combinations of codes, looking it up, and everything. I am trying to make an item that chooses a random item from an array list.

 

The code I have below is the one I once thought it was close, but I changed it, and I’m just not positive anymore. Am I heading in the wrong direction? How would I get to this item choosing a random item from a list of items I declare?

 

public ItemStack onItemRightClick(ItemStack var1, World var2){
var1.getItem();
return var1;



}

List item = Arrays.asList(Item.diamond, Item.bakedPotato, Item.appleRed, Item.book);



}

 

Most likely this code is wrong, I’m pretty sure of it. Any help would be great, thanks! :)

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.