Posted December 21, 20168 yr So I've made a few items in my mod, and I'm trying to figure out how to make an item action. My item(s) of interest are a syringe(blood and not used), and I'm wondering how you code it so that when the syringe is used, it turns into a syringe with blood. Here's my code for the item: package DrDaron5.RobotMod.items.itemclasses; import DrDaron5.RobotMod.Reference; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; public class ItemSyringe extends Item{ String type; public ItemSyringe(String unlocalizedName, String registryName){ this.setUnlocalizedName(unlocalizedName); this.setRegistryName(Reference.MODID, unlocalizedName); type = "clean"; } public ItemSyringe(String unlocalizedName, String registryName, boolean hasBlood){ this.setUnlocalizedName(unlocalizedName); this.setRegistryName(Reference.MODID, unlocalizedName); type = "blood"; } public boolean hasBlood(ItemSyringe sample){ if(sample.returnType().equals("blood")) return true; else return false; } public String returnType(){ { return type; } } } Anyone know? Thanks in advance
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.