Jump to content

Event's Item Stacks and Player's Inventory


Blaez

Recommended Posts

@SubscribeEvent
public void onItemCrafted(PlayerEvent.ItemCraftedEvent evt) {
    evt.player.inventory.addItemStackToInventory(new ItemStack(Blocks.DIRT, 64));
    System.out.println("random event fired");
}

 

This work's however, I'm wondering if there is a way to modify this to accept loot from a custom loot table. I'm not too familiar with loot table's and most of what I can find is older and for out of date versions and only handling loot chests.

is there a simple way of doing this or if there isn't please don't strain yourself however, I'd appreciate a point in the right direction if nothing else. thanks in advance. Also yes I know this is a bad example and will fire for every item crafted however I'm trying to work out what works first.

Link to comment
Share on other sites

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.