Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Fruitsalid

Members
  • Joined

  • Last visited

Everything posted by Fruitsalid

  1. I don't know what I'm doing wrong (Sorry if I'm being terribly ignorant or annoying) but it's not adding a delay and if I go into survival it uses 2 of the item when I click once. public class ItemMagicPotato extends Item { private final int cooldown = 200; public ItemMagicPotato(int par1) { super(par1); this.maxStackSize = 8; } @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if(par3EntityPlayer.capabilities.isCreativeMode||par3EntityPlayer.inventory.consumeInventoryItem(MagicElementsMod.magicpotato.itemID)) { NBTTagCompound nbt = par1ItemStack.getTagCompound(); if(nbt == null) { nbt = new NBTTagCompound(); par1ItemStack.setTagCompound(nbt); } int delay = nbt.getInteger("delay"); if(delay == 0) { if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntityMagicPotato(par2World, par3EntityPlayer)); } par1ItemStack.stackSize--; delay = cooldown; } } return par1ItemStack; } @Override public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { NBTTagCompound nbt = par1ItemStack.getTagCompound(); if(nbt == null) { nbt = new NBTTagCompound(); par1ItemStack.setTagCompound(nbt); } int delay = nbt.getInteger("delay"); if(delay > 0) { delay--; nbt.setInteger("delay", delay); } } public boolean hasEffect(ItemStack par1ItemStack) { return true; } }
  2. i've pasted the line there but now it throws two entities? I right click once and it throws two at a half second interval between.
  3. Sorry, im must be blind lol
  4. If I use the second set of code, where do I put the spawn entity?
  5. Well thanks, Ill try putting it in the code and ask if any problems occur.
  6. what does this delay method look like lol sorry. oh and I modified my comment above if you know how to fix the second part too?
  7. also do you know how to add a delay so you cant spam right click the item and make the entity come out of my hand and not my face?
  8. Well i figured it out. I used render fireball. But now the problem is that when i throw it, the entity is like 50x the normal size. How do I make it smaller?
  9. I've used that tutorial to make an item which shoots a custom entity. I'm not sure how to make the item shoot an entity which looks exactly like the item. That tutorial explains how to make an item, like a bow, which shoots a different projectile. I'm looking to make a snowball type item.
  10. I was wondering how to make an entity look like the item used to throw it. (Just like a snowball) I copied the rendersnowball class but it didn't really work. What code would I use to do this?
  11. I was rushing so I didn't bother looking it over but thanks and no it's not mean lol.
  12. public class RenderLaser extends Render { int red = 200; int green = 40; int blue = 40; int alpha = 250; @Override public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { this.func_110777_b(entity); GL11.glPushMatrix(); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glTranslatef((float)d0, (float)d1, (float)d2); GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * f1 - 90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * f1, 0.0F, 0.0F, 1.0F); Tessellator tessellator = Tessellator.instance; tessellator.setColorRGBA(red, green, blue, alpha); byte b0 = 0; float f2 = 0.0F; float f3 = 0.5F; float f4 = (float)(0 + b0 * 10) / 32.0F; float f5 = (float)(5 + b0 * 10) / 32.0F; float f6 = 0.0F; float f7 = 0.15625F; float f8 = (float)(5 + b0 * 10) / 32.0F; float f9 = (float)(10 + b0 * 10) / 32.0F; float f10 = 0.05625F; GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); GL11.glScalef(f10, f10, f10); GL11.glTranslatef(-4.0F, 0.0F, 0.0F); GL11.glNormal3f(f10, 0.0F, 0.0F); for (int i = 0; i < 4; ++i) { GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); tessellator.startDrawingQuads(); tessellator.setColorRGBA(red, green, blue, alpha); tessellator.addVertex(-8.0D, -2.0D, 0.0D); tessellator.addVertex(8.0D, -2.0D, 0.0D); tessellator.addVertex(8.0D, 2.0D, 0.0D); tessellator.addVertex(-8.0D, 2.0D, 0.0D); tessellator.draw(); } GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); } @Override protected ResourceLocation func_110775_a(Entity entity) { return null; } }
  13. http://imagebin.org/264970
  14. I have a picture but I don't get how to use the insert image.
  15. It seems to appear on random living entities. But only one at a time. And how do I use this insert image thing? lol
  16. I've already made a render class for the bullet. It works fine and looks like I want it to. When I shoot it fires and does damage and interacts with mobs. I've registered it in the proxy. But when I look down and shoot the white rectangle flashes.
  17. When I aim at the ground and shoot the gun I made, a large rectangle, the same color as the entity (bullet) just flashes in front of my view. In third person I can see it's roughly 4 blocks wide and 3 high. Completely flat. How can I fix this?
  18. How would I set the lifespan of an entity so after lets say 30 ticks it would disappear?
  19. Which sections of dynamic lighting should I be looking at? I know I would have to create an updater to make the light emitted follow me but since the mod has several different light emitting things, I'm not sure where to look.
  20. I would like to create an item that when right clicked with, it will start to light up the area around you.(Like a lantern) What would I need to put into the onRightClick method to make it switch between the off item and on item? Also how do you add a light value to an item?
  21. Yes, I put this in my main class: @EventHandler public void init(FMLPreInitializationEvent event) { RenderingRegistry.registerEntityRenderingHandler(EntityThrowableItem.class, new RenderThrowableItem()); } And made the render class for it. And a question. Are all three of these classes (the item, entity and render) just taking the items image and using it for the entity then rendering it?
  22. I don't know, I copied exactly what the forum post said - didn't work. Copied exactly what you had - still didn't work.
  23. i made a couple of items which I thought would be interesting to make them throwable. I just copied the snowball item and entity classes and adjusted the item class line: -par2World.spawnEntityInWorld(new EntitySnowball(par2World, par3EntityPlayer)); No errors occur but when I right click, no entity appears. It does hit mobs. What do I have to add to make the entity appear?

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.