
ogrekpl
Members-
Posts
16 -
Joined
-
Last visited
Everything posted by ogrekpl
-
Yes, but still, I probably need to take specific item, 'coz player might have 10 similar items. I thought I have find one, copy it, damage this copy, remove original and add copied one. Am I correct? Probably I'm too nooby. Why it's triggering twice not once? Item I got in hand is fireing one(ITEM_FIREDIAMOND_FIREING), and by clicking it I get dmg as player and receive stable one (ITEM_FIRE_DIAMOND)
-
Ok i got it. Some my bad implementations in inicialization items. Thanks DavidM for Entity#attackEntityFrom and Draco18s, diesieben07 too Additional, I wounder, in what way I can damage item from inventory (decrese durability from 20 to 19 - by 1 point) @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { ItemStack item = playerIn.getHeldItem(handIn); ItemStack itemStack = new ItemStack(ItemInit.ITEM_GRINDER_BOWL); // item with durability ItemStack itemStackReturn = new ItemStack(ItemInit.ITEM_FIRE_DIAMOND); if (playerIn.inventory.hasItemStack(itemStack)) { playerIn.attackEntityFrom(DamageSource.ON_FIRE, 3.0f); playerIn.addItemStackToInventory(itemStackReturn); int slotNr = playerIn.inventory.findSlotMatchingUnusedItem(itemStack); // find slot nr where is this item i want decrese durability ItemStack damageItemStack = new ItemStack(***); // here i want to copy item from inventory //someItemStack.setItemDamage(someItemStack.getItemDamage() - 1); // decrease durabilit of item that i copied playerIn.inventory.removeStackFromSlot(slotNr); //remove original item //add this copied item with 1 less durability return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, ItemStack.EMPTY); } else { return new ActionResult<ItemStack>(EnumActionResult.FAIL, item); } } This is my idea but i cant find methods for taking ItemStack from item in inventory(e.g by slot nr) I hope you know what I need
-
Hello guys! I'm not sure what am I doing wrong What I want to do: - if player got in inventory specify item do: - deal dmg to player - add new intem to inventory - delete item from hand public class ItemFireDiamondFireing extends ItemBase implements IHasModel { public ItemFireDiamondFireing(String name) { super(name); } @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { ItemStack item = playerIn.getHeldItem(handIn); ItemStack itemStackIn = new ItemStack(ItemInit.ITEM_GRINDER_BOWL); if (playerIn.inventory.hasItemStack(itemStackIn)) { float dmg = 20.0f; // x dmg playerIn.setHealth(playerIn.getHealth() - dmg); //Deal x DMG playerIn.addItemStackToInventory(itemStackIn); // some item } return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, item); }
-
[1.12.2] Item with lost durability can't be used in crafting
ogrekpl replied to ogrekpl's topic in Modder Support
Thanks ❤️ -
Hi guys! I im not very good at forge, so I came here with this problem. I make item able to lose durability. When I put it in craftingtable with full durability crafting recipe works, but when is e.g. 19/20 durability its not working. I wish you could help me :) ItemClass: public class ItemGrinderBowl extends ItemBase implements IHasModel { public ItemGrinderBowl(String name) { super(name); setMaxDamage(20); setMaxStackSize(1); } @Override public boolean hasContainerItem() { return true; } @Override public ItemStack getContainerItem(ItemStack itemStack) { ItemStack newItemStack = itemStack.copy(); newItemStack.setItemDamage(newItemStack.getItemDamage() + 1); return newItemStack; } } crafting .json { "type": "minecraft:crafting_shapeless", "ingredients": [ { "item": "ogeldiamonds:item_water_diamond" }, { "item": "ogeldiamonds:item_grinder_bowl" } ], "result": { "item": "ogeldiamonds:item_water_diamond_dust", "count": 1 } }
-
Thanks a lot
-
Hi guys I have got small problem with my custom item with damage bar. It's a very small problem but important for me When I want to craft sth more than one time I'm not able to do it. I made one trick which help me with it. Just look at src code: Item Class Crafting SRC code This trick is works that i add this 0 after 1 which means value of damage from this item. I saw it in ItemStack.class int p_i1881_3_ - it means itemDamage Ok but doing it in this way is very long cuz' i have to add aditional lines of code because i want to use 16 times this item until he will crash, so it looks like that. Could anyone help me with it? Any sugestions that I could do it in other way? PS: Sorry for my english I'm not good at all.
-
Oh my god. In 1.6.X was .getID now it doesn't works. No do you understand or not? O wann't listen to some one who would like be as my mum but anyone whou is able to help me.
-
You can change it in ToolMaterial. You must first of all register youre tool material. It looks like it: WaterDiamondMaterial = new EnumHelper().addToolMaterial("WaterDiamondMaterial", 3, 2800, 11.0F, 4.5F, 20); one on this paramiter change damage but i m not sure which execly. ~ogrekpl
-
Hi guys. I have got problem. I dont know what i must add in FuelHandler. It it look like that: package net.elementarydiamonds.main; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.IFuelHandler; public class FuelHandler implements IFuelHandler { @Override public int getBurnTime(ItemStack fuel) { return 0; } } So what i must give inside. Please help me as fast as it is possible. ~ogrekpl
-
Hi guys. I have got one question. How i can make item with damge. It means that i can use it in the crafting table for example 5 times. Could some one help me with it? PS: I will be tommorw in Talin and I will be able to anserw for it on Saturday.
-
I love u Thank you very much!
-
There is my Error Log: http://pastebin.com/FkuHhBcs Main Class: http://pastebin.com/wPkByrb3 ClientProxy Class: http://pastebin.com/Lmb94v0k CommonProxy Class: http://pastebin.com/YVXVMmsm Could Some one HELP me plz