Jump to content

Failender

Forge Modder
  • Posts

    1091
  • Joined

  • Last visited

Everything posted by Failender

  1. public void onUpdate(ItemStack itemstack, World worldIn, Entity entity, int itemSlot, boolean isSelected)
  2. you dont need to search for the item, you get it passed as argument (int itemSlot)
  3. player.mainInventory.setStackInSlot(randomIndex, itemstack); player.mainInventory.setStackInSlot(itemSlot, null);
  4. while(true) int randomIndex=random.nextInt(maxIndex); if(inv.getSlot(randomIndex)==null) placeItemHereAndSetOtherOneNull(); //TODO: prevent infinite loop
  5. if the new item is in a different slot simply set the old one to null
  6. EntityPlayer player= (EntityPlayer) entity; if(entity instanceof EntityPlayer) Rethink this code please.
  7. why do you want to have a custom inventory if you want to use the default vanilla? Instead of using ur own inventory just use the vanilla one (in case u are using a gui)
  8. set the old slot where the itemstack was to null/replace it with the new one. java garbage collection will do the rest
  9. The first argument of setInventorySlotContents is the index, not the stacksize.
  10. if(held == new ItemStack(Items.bone)){ ItemStack out = new ItemStack(Items.iron_ingot); EntityItem entity = new EntityItem(world, player.posX, player.posY, player.posZ, out); world.spawnEntityInWorld(entity); } Im not sure what you are triing to do there. if(held.getItem()==Items.bone);
  11. only create the explosion on server side (!if(world.isRemote))
  12. No. Dont use event.getSide() , that is stuff proxies are made for.
  13. you should consider fixxing those 200 other errors u got in ur log first..
  14. jesus christ what is up with that error log? try some basic debugging. u got a NPE in ur shouldExecute method, either theEntity or theEntity.getAttackTarget() is null
  15. normally a check !world.isRemote will work . depends on where u call it
  16. even winrar can edit jar files sir..
  17. you want a hacky way? decompile it , add it to your workspace and compile ur mod with the library inside. i bet there are better ways
  18. you only need to kill the entity on server side, client sid will get informed
  19. okay, I guess that is the better solution :b
  20. Create a new project, gradlew setupDecomp.. And setup eclipse after that copy ur source folder into the new project
  21. just google "minecraft remove recipe" there is everything you need
×
×
  • Create New...

Important Information

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