Everything posted by Fruitsalid
-
How to make entity look like item?
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; } }
-
How to make entity look like item?
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.
-
How to make entity look like item?
Sorry, im must be blind lol
-
How to make entity look like item?
If I use the second set of code, where do I put the spawn entity?
-
How to make entity look like item?
Well thanks, Ill try putting it in the code and ask if any problems occur.
-
How to make entity look like item?
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?
-
How to make entity look like item?
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?
-
How to make entity look like item?
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?
-
How to make entity look like item?
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.
-
How to make entity look like item?
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?
-
Large rectangle appears when entity shot?
I was rushing so I didn't bother looking it over but thanks and no it's not mean lol.
-
Large rectangle appears when entity shot?
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; } }
-
Large rectangle appears when entity shot?
http://imagebin.org/264970
-
Large rectangle appears when entity shot?
I have a picture but I don't get how to use the insert image.
-
Large rectangle appears when entity shot?
It seems to appear on random living entities. But only one at a time. And how do I use this insert image thing? lol
-
Large rectangle appears when entity shot?
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.
-
Large rectangle appears when entity shot?
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?
- Lifespan of an entity?
-
Lifespan of an entity?
How would I set the lifespan of an entity so after lets say 30 ticks it would disappear?
-
Handheld glowing item [1.6.2]
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.
-
Handheld glowing item [1.6.2]
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?
-
How to create a throwable item? [1.6.2]
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?
-
How to create a throwable item? [1.6.2]
I don't know, I copied exactly what the forum post said - didn't work. Copied exactly what you had - still didn't work.
-
How to create a throwable item? [1.6.2]
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?
IPS spam blocked by CleanTalk.