Posted August 18, 201411 yr Hi! I an kind of stuck in my modding because i cant get get whats in a specific slot.
August 18, 201411 yr If you have a reference to a player, you can get an ItemStack in, for example, the fourth slot like this: ItemStack stack = player.inventory.getStackInSlot(3); If you want the item: Item item = stack.getItem();
August 18, 201411 yr just make sure that before you do anything with a gotten ItemStack make sure it's not null Currently updating my Mod to 1.10.2 https://bitbucket.org/hugo_the_dwarf/riseoftristram2016/src?at=master
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.