Jump to content

KakesRevenge

Members
  • Posts

    153
  • Joined

  • Last visited

Everything posted by KakesRevenge

  1. Im stilll wondering how EXACTLY get the color of the sheep that im interacting with ... in entitysheep class the getFleeceColor method isnt static so i cant use it...
  2. dunno if thats a problem i will do it another way
  3. This is what ive got so far ... but its crashing public class ClayBucketHandler { protected DataWatcher dataWatcher; public boolean getSheared() { return (this.dataWatcher.getWatchableObjectByte(16) & 16) != 0; } @SubscribeEvent public void EntityInteract(EntityInteractEvent event) { if(event.target instanceof EntitySheep) { Item equipped = event.entityPlayer.getCurrentEquippedItem().getItem(); EntityPlayer player = event.entityPlayer; int color = dataWatcher.getWatchableObjectByte(16) & 15; if(equipped == ItemsHandler.ClayBucketFired) { player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(ItemsHandler.ClayBucketWool)); player.inventory.addItemStackToInventory(new ItemStack(Blocks.wool, 1, color )); } }
  4. ok thank you it looks like this : But i cant get the datawatcher in public int getFleeceColor() { return EntitySheep.getDataWatcher().getWatchableObjectByte(16) & 15; }
  5. i have looked and i dont understand it this is the interactwithentity method in ItemShears
  6. Hey, Im trying to find out what wool color a particular sheep has. So when I right click the sheep, I want to get the color it has. And I want to make the sheep sheared when I get the wool out of it. Any ideas will be appreciated
  7. you should really look on more tuts apperantly you dont understand how recipes work
  8. Im removing drops like so if (event.drops != null && event.drops.size() != 0) { for (int x = event.drops.size() - 1; x >= 0; x--) { event.drops.remove(x);
  9. Please be specific ... How to get the item first ?
  10. error is "incompatible conditional operand types ItemStack and ItemBlock" smeltedblockoneye looks like this ItemStack smeltedblockoneye = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(blockoneye)).copy();
  11. if(smeltedblockoneye instanceof ItemBlock) { this gives me an error
  12. Hey, how can i check if itemstack is item ? i want to set here that if the smelting result is instance of block then do my thing nad the same thing with item how to this ?
  13. well reinstalling eclipse did not work but remaking workspace did
  14. It doesnt work ... im gonna try re-install eclipse
  15. Hello, so i have weird issue when when im triying to run game it says i have an error but eclipse does not show any errors ? what is happening ? Thanks for any response ...
  16. In My eventhandler class @SubscribeEvent public void checksomething (LivingUpdateEvent event) { if(event.entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entityLiving; if(player.inventory.hasItem(ItemsHandler.Corn)) { System.out.println("SOMETHING !"); FMTMethods.setExtraReach(player, 3.5F); } } } This will get printed out but the setExtraEach doesnt work System.out.println("SOMETHING !");
  17. Hello, trying to increase range of players hand public static void setExtraReach(EntityLivingBase entity, float reach) { if(entity instanceof EntityPlayerMP) ((EntityPlayerMP) entity).theItemInWorldManager.setBlockReachDistance(Math.max(5, ((EntityPlayerMP) entity).theItemInWorldManager.getBlockReachDistance() + reach)); } This Method doesnt work my question is why ? and how to fix it ?
  18. Ok im just littlebit derpy i did register it wrong way so now it works For anybody Main class : MinecraftForge.EVENT_BUS.register(handler); FMLCommonHandler.instance().bus().register(handler); handler class @SubscribeEvent public void whenCrafted(ItemCraftedEvent event) { if(event.crafting.getItem().equals(Items.sugar)) { event.player.inventory.addItemStackToInventory(new ItemStack(Items.diamond)); } }
  19. Hello, Im trying to use ItemCraftedEvent and it doesnt work private static EntityPlayer player; @SubscribeEvent public void whenCrafted(ItemCraftedEvent event) { if(event.crafting.getItem().equals(Items.sugar)) { player.inventory.addItemStackToInventory(new ItemStack(BadItems.Molasses)); } } EDIT : That doesnt work either event.player.inventory.addItemStackToInventory(new ItemStack(BadItems.Molasses));
  20. Well it doesnt matter i found it you got problem in here : @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer){ if(stack.getItem().equals(BetterArmourAndTools.helmetEmerald)|| stack.getItem().equals(BetterArmourAndTools.chestplateEmerald)|| stack.getItem().equals(BetterArmourAndTools.legsEmerald)){ return "tools:textures/armor/Emerald_1.png"; } if(stack.getItem().equals(BetterArmourAndTools.legsEmerald)){ return "tools:textures/armor/Emerald_2.png"; } in the first one emerald 1 you need to change legs to boots
  21. Ok thats usefull too but i mean your BetterArmourAndTool class
  22. and show me code in your class where you are registering the armor
×
×
  • Create New...

Important Information

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