Posted August 20, 20178 yr If I use markDirty() to save inventory changes, it get me fail. What can make problems? May be I must import library, or something else? Part of code where I use it if (entity.capabilities.isCreativeMode) { if (entity.inventory.getCurrentItem() != null && entity.inventory.getCurrentItem().getItem() == mcreator_expand1.block) { if (true) { if (entity instanceof EntityPlayer) ((EntityPlayer) entity).inventory.setInventorySlotContents(selSlot, new ItemStack(mcreator_expand50.block, 1)); stopExpand = 1; markDirty(); } } }
August 20, 20178 yr Author I solve the problem with fail if (entity.capabilities.isCreativeMode) { if (entity.inventory.getCurrentItem() != null && entity.inventory.getCurrentItem().getItem() == mcreator_expand1.block) { if (true) { if (entity instanceof EntityPlayer) ((EntityPlayer) entity).inventory.setInventorySlotContents(selSlot, new ItemS(mcreator_expand50.block, 1)); ((EntityPlayer) entity).inventory.markDirty(); } } } but it isn`t help with my problem...
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.