Jump to content

ImUnreal

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by ImUnreal

  1. Like i said, im a complete beginner and only know the really basic stuff, im learning it as i go i suppose. Do you know a good source where i can learn the basic java needed for modding(or just writing java in general), so i dont have to bother anyone like this ?
  2. this doesnt work either, and i have no idea why public ItemStack hitEntity(ItemStack itemStack, World world, EntityPlayer player) { world.playSoundAtEntity(player, "mod:lightsaberswing", 1.0F, 1.0F); return itemStack; }
  3. Yes, thats the problem, this is how it works with onItemRightClick, im trying to get it to work with hitEntity, but i have no idea how.
  4. So im trying to make my custom lightsaber item play a sound when hitting an entity. I got it to work with the method onItemRightClick, but i cant get it to work with hitEntity. Im rather new to modding and id like to get help. Here is the working code public class ItemModLightsaber extends ItemSword { public ItemModLightsaber(ToolMaterial Kyber, String unlocalizedName) { super(Kyber); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(IRCrTab.tabIRItems); this.setTextureName("mod:" + unlocalizedName); } @Override public boolean hitEntity(ItemStack stack, EntityLivingBase hitEntity, EntityLivingBase attackingEntity) { hitEntity.setFire(4); return true; } public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { world.playSoundAtEntity(player, "mod:lightsaberswing", 1.0F, 1.0F); return itemStack; } }
×
×
  • Create New...

Important Information

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