Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

TANDEROID

Members
  • Joined

  • Last visited

  1. 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...
  2. 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(); } } }
  3. Sorry, but the most of this code isn`t mine, I use ModCreator, so I understend not more the 20% of that. I just want to solve this problem. So, my problem was called by reaching across logical sides, or the reason not here?
  4. Bigger code slice public class KeyHandlerClass { private static final String desc = "Previous range"; private static final int keyValues = Keyboard.KEY_LBRACKET; private final KeyBinding keys; public KeyHandlerClass() { keys = new KeyBinding(desc, keyValues, "World Edit helpers"); ClientRegistry.registerKeyBinding(keys); } @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { if (!FMLClientHandler.instance().isGUIOpen(GuiChat.class)) { if (keys.isPressed()) { EntityPlayer entity = Minecraft.getMinecraft().thePlayer; MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); World world = server.worldServers[0]; int selSlot = ((EntityPlayer) entity).inventory.currentItem ; if (entity.capabilities.isCreativeMode) { if (entity.inventory.getCurrentItem() != null && entity.inventory.getCurrentItem().getItem() == expand20.block) { if (true) { if (entity instanceof EntityPlayer) ((EntityPlayer) entity).inventory.setInventorySlotContents(selSlot, new ItemStack(expand10.block, 1)); } } } } } } } }
  5. int selSlot = ((EntityPlayer) entity).inventory.currentItem ; if (entity.capabilities.isCreativeMode) { if (entity.inventory.getCurrentItem() != null && entity.inventory.getCurrentItem().getItem() == expand20.block) { if (true) { if (entity instanceof EntityPlayer) ((EntityPlayer) entity).inventory.setInventorySlotContents(selSlot, new ItemStack(expand10.block, 1)); } } }
  6. I use this code to replace item in hotbar slot ((EntityPlayer) entity).inventory.setInventorySlotContents(5, new ItemStack(example.block, 1)); and this works, but if I use this item(RClick) it go back to the previous state. But! If I open inventory and pick it and put in any slot it won`t go back to the previous state after RClick.
  7. I was not sure that I would succeed and therefore asked for help. But this code works ! ((EntityPlayer) entity).inventory.setInventorySlotContents(5, null); Thank you!
  8. Could you write me example of this code? I'm new to modding
  9. For example I want remove item from 5th slot of toolbar. How I can do this?

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.