Jump to content

Born2Code

Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by Born2Code

  1. That shortcut isn't working, but if all of the usages are in the Minecraft class, where at? And if they're somewhere else for the entity handling, can you please tell me where?
  2. Please give an example, because I'm still having a hard time.
  3. Look at how ItemReed does it, that's what string uses instead of the normal Item class. And if you didn't know, the string item when placed places tripwire.
  4. Hello! I have a mod that has an item that will cause lightning to strike at your cursor when you right-click it. I want it to not strike lightning if I right-click on a slime. I know I could use itemInteractionForEntity or something like that but the reach is too short for what I want to do. So I made an invisible entity that will fly out to where my cursor (instantly) is pointing at to detect if I'm looking at an entity. If I add a println in the detection entity, it will print out the name of the entity I'm looking at if I am looking at one. So I changed that to only print when I'm looking at a slime. Everything is working so far. But I don't know how to only strike lightning, if I'm looking at a slime. Currently, only the detection entity knows what I'm looking at, so .... 1. Spawn lightning inside of the detection entity class... (which I can't get to work) 2. Somehow pass that information over to the item in order to cause the lightning to strike or not strike (can cause the lightning but don't know how to pass the info over)
  5. Exactly what he said, plus.. a little extra tip, give those sensible names, not par1world, par2player etc... name them world, player, etc etc... can be very helpful when you start doing more advanced things =)
  6. Thanks! One last thing though, how would I know where the player is facing in order to shoot it out in that direction? EntityTNTPrimed mytnt = new EntityTNTPrimed(world, player.posX, player.posY, player.posZ, player); mytnt.motionX += 10; world.spawnEntityInWorld(mytnt); The above works, but it (obviously) only shoots out in one direction.
  7. Hello, I appreciate the help, but I don't quite see how I would do that. Here is my launcher item class when I spawn the entity, if you could let me know how I would do that I would appreciate that =) package teampap.grenade.items; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import teampap.grenade.lib.Constants; public class ItemTNTLauncher extends Item { private String name = "tntLauncher"; public ItemTNTLauncher() { setUnlocalizedName(Constants.MODID + "_" + name); setCreativeTab(CreativeTabs.tabCombat); } public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) { item.damageItem(1, player); if (!world.isRemote) { world.spawnEntityInWorld(new EntityTNTPrimed(world, player.posX, player.posY, player.posZ, player)); } return item; } }
  8. Hello, I'm working on a mod that has a tnt launcher. Well the basic primed tnt entity simply falls to the ground which I don't want. So I made my own custom tnt entity to change that (so that it shoots out), but for some reason I can't get it to render. Currently both my render class and entity class are the same as the originals. Any amount of help is appreciated. Main Mod File ClientProxy EntityMyTNT RenderMyTNT
×
×
  • Create New...

Important Information

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