Jump to content

perromercenary00

Members
  • Posts

    849
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by perromercenary00

  1. good days as in the title explain i wanna make an inventory whith a gui in which you just can interacc whith the enable itemSlots is becose i make a gui that allow acces to mobs inventory things like armours and held item , and i dont wanna have player exploting this to dissarm armed mobs or pillage expensive items from mobs or other players
  2. yaa it just come with all bunch of code thanks later i gionne search some opengui tutorial
  3. good days again I'm trying to make something a little complicated i have a guns mod in order to give to the entities more munition i create a little inventory like a chess but in the handgun like a backpack with nine slots but with the hability to shoot bullets to do this i scavenge the code from the dispenser tileentity an make some changes actually most of the code works, if i aim to an entity that holds the m92 handgun an press NumKeyEnter its open the menu whith the nine slots from the gun hold by the entity. if i put munition and magazines inside this inventory mi entities are able to use it to reload the gun and keep shooting so the inventory works and can be recalled by other classes or entities the trouble its if i try to move an item two times in a row this item disappears from the inventory lets say i take a bullets Stack from the player inventory an put it in the slot 0 from the gun inventory well if i close the inventory and reopen it later everyting works as expected, at reopen there is a bullet stack in the slot 0 from the gun inventory but if i take the bullets from the player inventory and put them in the slot 0 from the gun and whitout closing inventory a take again that bullet stack and try to move then to slot 5 from the gun inventory or to any other sloth, the bullestack disappears ad instant or in the next close/open action if i just single move an item all works like it must but if i move it an then move it again it disappears i better i explain again whit this video like i say the code is taken from the dispenser class using the tha vainilla gui but taken the nbt from an item i set in the constructor well all the calls are done whith the keybind but triggered whith a package in the server side so the call are server side package mercenarymod.items.armasdefuego.inventario; import java.util.ArrayList; import java.util.Random; import net.minecraft.block.BlockChest; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.Container; import net.minecraft.inventory.ContainerDispenser; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.tileentity.TileEntityLockable; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraft.world.IWorldNameable; import net.minecraft.world.World; //################################################################################################### public class inventarioArmas extends TileEntityLockable implements IInventory //extends TileEntityDispenser implements IInventory { { private ItemStack pistola = null; private ItemStack[] inventario = new ItemStack[9]; private int SizeInventory = 9; private int conteodeEtiquetas = 0; private World worldIn = null; private static final Random RNG = new Random(); private String customName = "algo"; // ################################################################################################### public inventarioArmas(ItemStack pistola, World worldIn) { super(); this.pistola = pistola; this.worldIn = worldIn ; NBTTagCompound tagCompund = null; if (this.pistola != null) { tagCompund = pistola.getTagCompound(); if (tagCompund != null) { readFromNBT(tagCompund); } } } // ################################################################################################### /** * Returns the number of slots in the inventory. */ @Override public int getSizeInventory() // ItemStack pistola { int SizeInventory = 0; if (pistola != null) { SizeInventory = inventario.length; } return 9;//SizeInventory; } // ################################################################################################### /** * Returns the stack in slot i */ @Override public ItemStack getStackInSlot(int index) // , ItemStack pistola { ItemStack salida = null; String s = index +" null "; if (this.pistola != null) { salida = inventario[index]; //s ="getStackInSlot("+index+")"+salida.getUnlocalizedName() ; } //System.out.println(s); return salida; } // ################################################################################################### /** * Removes from an inventory slot (first arg) up to a specified number * (second arg) of items and returns them in a new stack. */ @Override public ItemStack decrStackSize(int index, int count) { System.out.println("decrStackSize(index="+index+", count"+count+")" ); ItemStack salida = null; if (this.pistola != null) { salida = inventario[index]; int cantidad = salida.stackSize; cantidad = cantidad - count; salida.stackSize = cantidad; if (cantidad < 1) { salida = null; } } return salida; } // ################################################################################################### /** * Add the given ItemStack to this Dispenser. Return the Slot the Item was placed in or -1 if no free slot is * available. */ public int addItemStack(ItemStack stack) { for (int i = 0; i < inventario.length; ++i) { if (inventario[i] == null || inventario[i].getItem() == null) { this.setInventorySlotContents(i, stack); return i; } } return -1; } // ################################################################################################### /** * When some containers are closed they call this on each slot, then drop * whatever it returns as an EntityItem - like when you close a workbench * GUI. */ @Override public ItemStack getStackInSlotOnClosing(int index) { ItemStack salida = null; if (this.pistola != null) { NBTTagCompound tagCompund = pistola.getTagCompound(); salida = inventario[index]; } return salida; } //################################################################################################### /** * Sets the given item stack to the specified slot in the inventory (can be * crafting or armor sections). */ @Override public void setInventorySlotContents(int index, ItemStack stack) { inventario[index] = stack; } //################################################################################################### /** * Returns the maximum stack size for a inventory slot. Seems to always be * 64, possibly will be extended. *Isn't this more of a set than a get?* */ @Override public int getInventoryStackLimit(){ return 64; } //################################################################################################### /** * For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it * hasn't changed and skip it. */ public void markDirty() { if (worldIn != null) { writeToNBT(getthisCompound()); /*ñaaa do nithing */ } } //################################################################################################### /** * Do not make give this method the name canInteractWith because it clashes * with Container */ @Override public boolean isUseableByPlayer(EntityPlayer player) { return true; } @Override public void openInventory(EntityPlayer player){ if (!player.isSpectator()) { /*ñaaa do nithing */ } } @Override public void closeInventory(EntityPlayer player) { if (!player.isSpectator() ) { /*ñaaa do nothing to */ } } //################################################################################################### /** * Returns true if automation is allowed to insert the given stack (ignoring * stack size) into the given slot. */ @Override public boolean isItemValidForSlot(int index, ItemStack stack) { return true; } @Override public int getField(int id) { return 0; } @Override public void setField(int id, int value) {} @Override public int getFieldCount() { return 0; } @Override public void clear() { for (int i = 0; i < inventario.length; ++i) { inventario[i] = null; } System.out.println("$$$ clear()"); } @Override public String getName() { return this.customName; } /** * Returns true if this thing is named */ @Override public boolean hasCustomName() { return true; } //@Override public void setCustomName(String name) { this.customName = name; } @Override public IChatComponent getDisplayName() { IChatComponent displayname = new ChatComponentText(EnumChatFormatting.RED +""+ pistola.getUnlocalizedName()+" sn:/"+getInttag(pistola, "numerodeserie") ); return displayname; } //################################################################################################### public NBTTagCompound getthisCompound(){ NBTTagCompound compound = new NBTTagCompound(); NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < inventario.length; ++i) { if (inventario[i] != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("Slot", (byte)i); inventario[i].writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); } } compound.setTag("Inventory", nbttaglist); // this.pistola.setTagCompound(compound); if (this.hasCustomName()) { compound.setString("CustomName", this.customName); } return compound; } // #########################################################################3 @Override public void readFromNBT(NBTTagCompound compound) { //super.readFromNBT(compound); NBTTagList nbttaglist = compound.getTagList("Inventory", 10); inventario = new ItemStack[this.getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); int j = nbttagcompound1.getByte("Slot") & 255; System.out.println("\n### read from nbt"); if (j >= 0 && j < inventario.length) { inventario[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); System.out.println("slot ="+i); if (inventario[j] != null) { System.out.println(" "+inventario[j].getUnlocalizedName() ); } System.out.println("###\n"); } } if (compound.hasKey("CustomName", ) { this.customName = compound.getString("CustomName"); } } // #########################################################################3 @Override public void writeToNBT(NBTTagCompound compound) { // super.writeToNBT(compound); NBTTagList nbttaglist = new NBTTagList(); System.out.println("\n### write to nbt"); for (int i = 0; i < inventario.length; ++i) { if (inventario[i] != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("Slot", (byte)i); inventario[i].writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); System.out.println("slot"+i+" ="+inventario[i].getUnlocalizedName() ); } } System.out.println("### \n"); compound.setTag("Inventory", nbttaglist); NBTTagCompound pistolaIn = this.pistola.getTagCompound(); pistolaIn.setTag("Inventory", nbttaglist); this.pistola.setTagCompound(pistolaIn); if (this.hasCustomName()) { compound.setString("CustomName", this.customName); } } // #########################################################################3 public int getDispenseSlot() { int i = -1; int j = 1; for (int k = 0; k < inventario.length; ++k) { if (inventario[k] != null && RNG.nextInt(j++) == 0) { i = k; } } return i; } // #########################################################################3 public String getGuiID() { return "minecraft:dispenser"; } public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { return new ContainerDispenser(playerInventory, this); } // #########################################################################3 public static float getFloattag(ItemStack item, String tag) { NBTTagCompound etiquetas = item.getTagCompound(); if (etiquetas == null) { etiquetas = new NBTTagCompound(); item.setTagCompound(etiquetas); return 999.9F; } float ex = etiquetas.getFloat(tag); return ex; } // #########################################################################3 public static void setFloattag(ItemStack item, String tag, float value) { NBTTagCompound etiquetas = item.getTagCompound(); if (etiquetas == null) { etiquetas = new NBTTagCompound(); } etiquetas.setFloat(tag, value); item.setTagCompound(etiquetas); } // #########################################################################3 public static int getInttag(ItemStack item, String tag) { NBTTagCompound etiquetas = item.getTagCompound(); if (etiquetas == null) { etiquetas = new NBTTagCompound(); item.setTagCompound(etiquetas); return 0; } int ex = etiquetas.getInteger(tag); return ex; } // #########################################################################3 public static void setInttag(ItemStack item, String tag, int value) { NBTTagCompound etiquetas = item.getTagCompound(); if (etiquetas == null) { etiquetas = new NBTTagCompound(); } etiquetas.setInteger(tag, value); item.setTagCompound(etiquetas); } // #########################################################################3 public static int[] getIntArraytag(ItemStack item, String tag) { NBTTagCompound etiquetas = item.getTagCompound(); if (etiquetas == null) { etiquetas = new NBTTagCompound(); item.setTagCompound(etiquetas); int[] empty = { 0 }; return empty; } int[] ex = etiquetas.getIntArray(tag); return ex; } // #########################################################################3 public static void setIntArraytag(ItemStack item, String tag, int[] value) { NBTTagCompound etiquetas = item.getTagCompound(); if (etiquetas == null) { etiquetas = new NBTTagCompound(); } etiquetas.setIntArray(tag, value); item.setTagCompound(etiquetas); } // #########################################################################3 public static Boolean getBooleantag(ItemStack item, String tag) { NBTTagCompound etiquetas = item.getTagCompound(); if (etiquetas == null) { etiquetas = new NBTTagCompound(); item.setTagCompound(etiquetas); return false; } boolean ex = etiquetas.getBoolean(tag); return ex; } // #########################################################################3 public static void setBooleantag(ItemStack item, String tag, boolean value) { NBTTagCompound etiquetas = item.getTagCompound(); if (etiquetas == null) { etiquetas = item.getTagCompound(); } etiquetas.setBoolean(tag, value); item.setTagCompound(etiquetas); } // #########################################################################3 } code in the server side trigered by the package send from the keybind if (mensaje.equals("menu00")) { inventario(playerIn, mensaje, stack0); } } static void inventario(EntityPlayer playerIn, String mensaje, ItemStack pistola) { if (mensaje.equals("menu00")) { System.out.println("mensage recivido menu"); World worldIn = playerIn.worldObj; System.out.println("mundo = " + worldIn.isRemote); if (pistola != null){ int ownerId = getInttag(pistola, "ownerId"); } if (!worldIn.isRemote & playerIn instanceof EntityPlayer) { System.out.println("###1"); int playerId = playerIn.getEntityId(); float distancia = 5.0F; double eax = playerIn.posX; double eay = (playerIn.posY + playerIn.getEyeHeight()); double eaz = playerIn.posZ; double rotacionYaw = ((playerIn.rotationYaw / 180.0F) * 3.1415926); // rotacion // Horizontal // en // radianes double rotacionPitch = ((playerIn.rotationPitch / 180.0F) * 3.1415926); // rotacion // Vertical // en // radianes if (rotacionYaw < 0) { rotacionYaw = (2 * 6.2831852) + rotacionYaw; } rotacionYaw = rotacionYaw - 1.5707963; // correccion de -90 // grados if (rotacionYaw < 0) { rotacionYaw = (2 * 6.2831852) + rotacionYaw; } // System.out.println("rotacionPitch ="+ (rotacionPitch) ); // System.out.println("rotacionYawn ="+ (rotacionYaw) ); double nposX = eax - (double) (Math.cos(rotacionYaw)) * (Math.cos(rotacionPitch) * distancia); double nposY = eay - (Math.sin(rotacionPitch) * distancia);// 0.10000000149011612D // + double nposZ = eaz - (double) (Math.sin(rotacionYaw)) * (Math.cos(rotacionPitch) * distancia); Vec3 vec31 = new Vec3(eax, eay, eaz); Vec3 vec3 = new Vec3(nposX, nposY, nposZ); System.out.println("###2 " + vec3); System.out.println("motion " + (nposX - eax) + " , " + (nposY - eay) + " , " + (nposZ - eaz)); System.out.println("0"); MovingObjectPosition movingobjectposition = worldIn.rayTraceBlocks(vec31, vec3, false, true, false); System.out.println("1"); vec31 = new Vec3(eax, eay, eaz); vec3 = new Vec3(nposX, nposY, nposZ); if (movingobjectposition != null) { vec3 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); System.out.println("hitvector=" + vec3); System.out.println("Blocke=" + worldIn.getBlockState(new BlockPos(vec3)).getBlock().getUnlocalizedName()); } System.out.println("2"); // ### Aqui estoy modificando para obtener la segunda entidad Entity entity = null; ArrayList<Entity> entidades = new ArrayList<Entity>(); entidades.clear(); List list = worldIn.getEntitiesWithinAABBExcludingEntity(playerIn, playerIn.getEntityBoundingBox().addCoord(nposX - eax, nposY - eay, nposZ - eaz).expand(1.0D, 1.0D, 1.0D)); double d0 = 0.0D; ArrayList<Double> distancias = new ArrayList<Double>(); distancias.clear(); int i; float f1; // only if (!world is remote) // if (!this.worldObj.isRemote) { for (i = 0; i < list.size(); ++i) { Entity entity1 = (Entity) list.get(i); if (entity1.canBeCollidedWith() && (entity1.getEntityId() != playerId)) { f1 = 0.3F; AxisAlignedBB axisalignedbb1 = entity1.getEntityBoundingBox().expand((double) f1, (double) f1, (double) f1); MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); if (movingobjectposition1 != null) { double d1 = vec31.distanceTo(movingobjectposition1.hitVec); if (entity1 != null) { entidades.add(entity1); distancias.add(d1); } if ((d1 < d0 || d0 == 0.0D)) { entity = entity1; d0 = d1; } } } } } // only if (!world is remote) boolean abrirMenuPropio = false; if (entity != null) { EntityLivingBase entity2 = null; if (entity instanceof EntityLivingBase) { entity2 = (EntityLivingBase) entity; System.out.println("entity2 = " + entity2.getName()); } else { abrirMenuPropio = true; } ItemStack gun = entity2.getHeldItem(); if (gun != null) { boolean isCompatibleGun = armasDisparables.esDisparable(gun); if (isCompatibleGun) { NBTTagCompound compound = gun.getTagCompound(); if (compound != null) { mercenarymod.items.armasdefuego.inventario.inventarioArmas invPistola = new mercenarymod.items.armasdefuego.inventario.inventarioArmas(gun, worldIn); invPistola.setCustomName("Entity whith Pistola"); ((EntityPlayer) playerIn).displayGUIChest(invPistola);// (TileEntityDispenser) } } } else { abrirMenuPropio = true; } } else { abrirMenuPropio = true; } if (abrirMenuPropio) { if (pistola == null) { abrirMenuPropio = false; } } if (abrirMenuPropio) { ItemStack gun = playerIn.getHeldItem(); boolean isCompatibleGun = armasDisparables.esDisparable(gun); if (isCompatibleGun) { NBTTagCompound compound = pistola.getTagCompound(); if (compound != null) { mercenarymod.items.armasdefuego.inventario.inventarioArmas invPistola = new mercenarymod.items.armasdefuego.inventario.inventarioArmas(pistola, worldIn); invPistola.setCustomName("playerIn Pistola"); ((EntityPlayer) playerIn).displayGUIChest(invPistola);// (TileEntityDispenser) setBooleantag(pistola, "menu00", false); } } } // get the gun from the entity // setInttag(pistola, "ownerId", playerIn.getEntityId()); } } } // #########################################################################3
  4. ee nop i have remember why i dont du that long ago when i make the guns if i set return EnumAction.BOW; if aplies the bow animation to the gun in the first person ichanging rotations and beging to move the gun slow backwards as if where a bow tigting and this looks awfull in the fireguns and dont want it well i want to make the steve rise the arms when shoot like when bow but whitout the anoying bow animation in the first person int the model biped there is this part this is where i dont know hot to reach this values to change them, as i do whith mi custom mob public void setModelAttributes(ModelBase p_178686_1_) { super.setModelAttributes(p_178686_1_); if (p_178686_1_ instanceof ModelBiped) { ModelBiped modelbiped = (ModelBiped)p_178686_1_; this.heldItemLeft = modelbiped.heldItemLeft; this.heldItemRight = modelbiped.heldItemRight; this.isSneak = modelbiped.isSneak; this.aimedBow = modelbiped.aimedBow; } } original vainilla modelBiped.class package net.minecraft.client.model; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ModelBiped extends ModelBase { public ModelRenderer bipedHead; /** The Biped's Headwear. Used for the outer layer of player skins. */ public ModelRenderer bipedHeadwear; public ModelRenderer bipedBody; /** The Biped's Right Arm */ public ModelRenderer bipedRightArm; /** The Biped's Left Arm */ public ModelRenderer bipedLeftArm; /** The Biped's Right Leg */ public ModelRenderer bipedRightLeg; /** The Biped's Left Leg */ public ModelRenderer bipedLeftLeg; /** Records whether the model should be rendered holding an item in the left hand, and if that item is a block. */ public int heldItemLeft; /** Records whether the model should be rendered holding an item in the right hand, and if that item is a block. */ public int heldItemRight; public boolean isSneak; /** Records whether the model should be rendered aiming a bow. */ public boolean aimedBow; private static final String __OBFID = "CL_00000840"; public ModelBiped() { this(0.0F); } public ModelBiped(float p_i1148_1_) { this(p_i1148_1_, 0.0F, 64, 32); } public ModelBiped(float p_i1149_1_, float p_i1149_2_, int p_i1149_3_, int p_i1149_4_) { this.textureWidth = p_i1149_3_; this.textureHeight = p_i1149_4_; this.bipedHead = new ModelRenderer(this, 0, 0); this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_); this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); this.bipedHeadwear = new ModelRenderer(this, 32, 0); this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_ + 0.5F); this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); this.bipedBody = new ModelRenderer(this, 16, 16); this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i1149_1_); this.bipedBody.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); this.bipedRightArm = new ModelRenderer(this, 40, 16); this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, p_i1149_1_); this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + p_i1149_2_, 0.0F); this.bipedLeftArm = new ModelRenderer(this, 40, 16); this.bipedLeftArm.mirror = true; this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, p_i1149_1_); this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + p_i1149_2_, 0.0F); this.bipedRightLeg = new ModelRenderer(this, 0, 16); this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1149_1_); this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + p_i1149_2_, 0.0F); this.bipedLeftLeg = new ModelRenderer(this, 0, 16); this.bipedLeftLeg.mirror = true; this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1149_1_); this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + p_i1149_2_, 0.0F); } /** * Sets the models various rotation angles then renders the model. */ public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); GlStateManager.pushMatrix(); if (this.isChild) { float f6 = 2.0F; GlStateManager.scale(1.5F / f6, 1.5F / f6, 1.5F / f6); GlStateManager.translate(0.0F, 16.0F * p_78088_7_, 0.0F); this.bipedHead.render(p_78088_7_); GlStateManager.popMatrix(); GlStateManager.pushMatrix(); GlStateManager.scale(1.0F / f6, 1.0F / f6, 1.0F / f6); GlStateManager.translate(0.0F, 24.0F * p_78088_7_, 0.0F); this.bipedBody.render(p_78088_7_); this.bipedRightArm.render(p_78088_7_); this.bipedLeftArm.render(p_78088_7_); this.bipedRightLeg.render(p_78088_7_); this.bipedLeftLeg.render(p_78088_7_); this.bipedHeadwear.render(p_78088_7_); } else { if (p_78088_1_.isSneaking()) { GlStateManager.translate(0.0F, 0.2F, 0.0F); } this.bipedHead.render(p_78088_7_); this.bipedBody.render(p_78088_7_); this.bipedRightArm.render(p_78088_7_); this.bipedLeftArm.render(p_78088_7_); this.bipedRightLeg.render(p_78088_7_); this.bipedLeftLeg.render(p_78088_7_); this.bipedHeadwear.render(p_78088_7_); } GlStateManager.popMatrix(); } /** * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how * "far" arms and legs can swing at most. */ public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { this.bipedHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); this.bipedHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); this.bipedRightArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 2.0F * p_78087_2_ * 0.5F; this.bipedLeftArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 2.0F * p_78087_2_ * 0.5F; this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F; this.bipedRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; this.bipedLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; this.bipedRightLeg.rotateAngleY = 0.0F; this.bipedLeftLeg.rotateAngleY = 0.0F; if (this.isRiding) { this.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F); this.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F); this.bipedRightLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); this.bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); this.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F); this.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F); } if (this.heldItemLeft != 0) { this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemLeft; } this.bipedRightArm.rotateAngleY = 0.0F; this.bipedRightArm.rotateAngleZ = 0.0F; switch (this.heldItemRight) { case 0: case 2: default: break; case 1: this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight; break; case 3: this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight; this.bipedRightArm.rotateAngleY = -0.5235988F; } this.bipedLeftArm.rotateAngleY = 0.0F; float f6; float f7; if (this.swingProgress > -9990.0F) { f6 = this.swingProgress; this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(f6) * (float)Math.PI * 2.0F) * 0.2F; this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY; this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY; this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY; f6 = 1.0F - this.swingProgress; f6 *= f6; f6 *= f6; f6 = 1.0F - f6; f7 = MathHelper.sin(f6 * (float)Math.PI); float f8 = MathHelper.sin(this.swingProgress * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F; this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX - ((double)f7 * 1.2D + (double)f8)); this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; this.bipedRightArm.rotateAngleZ += MathHelper.sin(this.swingProgress * (float)Math.PI) * -0.4F; } if (this.isSneak) { this.bipedBody.rotateAngleX = 0.5F; this.bipedRightArm.rotateAngleX += 0.4F; this.bipedLeftArm.rotateAngleX += 0.4F; this.bipedRightLeg.rotationPointZ = 4.0F; this.bipedLeftLeg.rotationPointZ = 4.0F; this.bipedRightLeg.rotationPointY = 9.0F; this.bipedLeftLeg.rotationPointY = 9.0F; this.bipedHead.rotationPointY = 1.0F; } else { this.bipedBody.rotateAngleX = 0.0F; this.bipedRightLeg.rotationPointZ = 0.1F; this.bipedLeftLeg.rotationPointZ = 0.1F; this.bipedRightLeg.rotationPointY = 12.0F; this.bipedLeftLeg.rotationPointY = 12.0F; this.bipedHead.rotationPointY = 0.0F; } this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; if (this.aimedBow) { f6 = 0.0F; f7 = 0.0F; this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F; this.bipedRightArm.rotateAngleY = -(0.1F - f6 * 0.6F) + this.bipedHead.rotateAngleY; this.bipedLeftArm.rotateAngleY = 0.1F - f6 * 0.6F + this.bipedHead.rotateAngleY + 0.4F; this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; this.bipedRightArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F; this.bipedLeftArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F; this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; } copyModelAngles(this.bipedHead, this.bipedHeadwear); } public void setModelAttributes(ModelBase p_178686_1_) { super.setModelAttributes(p_178686_1_); if (p_178686_1_ instanceof ModelBiped) { ModelBiped modelbiped = (ModelBiped)p_178686_1_; this.heldItemLeft = modelbiped.heldItemLeft; this.heldItemRight = modelbiped.heldItemRight; this.isSneak = modelbiped.isSneak; this.aimedBow = modelbiped.aimedBow; } } public void setInvisible(boolean invisible) { this.bipedHead.showModel = invisible; this.bipedHeadwear.showModel = invisible; this.bipedBody.showModel = invisible; this.bipedRightArm.showModel = invisible; this.bipedLeftArm.showModel = invisible; this.bipedRightLeg.showModel = invisible; this.bipedLeftLeg.showModel = invisible; } public void postRenderArm(float p_178718_1_) { this.bipedRightArm.postRender(p_178718_1_); } } thanks for answer
  5. i have an issue whit mi mod, i made a lot of fireguns very pretty and everything is perfect when i use them in first person camera but in third person looks like always the player shoot to the ground. i wanna make the player to extends both arms to the front when i shoot like when tigthen a bow, and this must be visible in third person for that now i know i need to set the value of certain variable named aimedBow to true in the ModelBiped.class than minecraft use to render the player and that's the trouble i don't even know how to get an instance of the ModelBiped the player is using to set in it the variable to true and the Model class don't seem to have getter setters for this variable i already got this i create a custom mob the pink haired girl whit which i use a custom ModelBiped i made and to make easy to set the values of aimedBow = ((mobMercenario) entity).getAimedBow(); isSneak = ((mobMercenario) entity).getisSneak(); heldItemRight = ((mobMercenario) entity).getHeldItemRight(); heldItemLeft = ((mobMercenario) entity).getHeldItemLeft(); i set this variables in mob class and create setters and getter's and make mi custom ModelBiped.class to take this values directly from the mob class so i could make her sneak or rise the arms whenever i want, and i wanna make the same whit the player sorry for the broken English i upload two videos showing the problem to compensate the pour explanation any ideas ?? thanks for reading
  6. little help i need whit this i have a lot of guns in mi mod in this case just speak about the SCARH, and i been working in make entityes capable of use this gun , i alredy have that the trouble is than the gun run out from ammo, wel now i wanna give to this entity more spare munition just by rigth clicking it whith loaded magazine i think lets make a little inventory inside the gun itself (fusil-SCARH) and set some more magazines for the later use of the mob im planing to make an animation of the mob changin magazine when it gets empty so i make this code based on the code from the entityLivingBase to store the 4 default armour slots magazine55645.class public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target) { //get the gun from the entity ItemStack gun = target.getHeldItem(); System.out.println("\n\n\n\n"); if (gun != null & !playerIn.worldObj.isRemote) { ArrayList<ItemStack> inventario = new ArrayList<ItemStack>(0); NBTTagCompound tagCompund = gun.getTagCompound(); NBTTagList nbttaglist = tagCompund.getTagList("Inventory", 6); System.out.println("In nbttaglist.tagCount()=" + nbttaglist.tagCount()); for (int i = 0; i < nbttaglist.tagCount(); ++i) { ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttaglist.getCompoundTagAt(i)); if (itemstack != null) { System.out.println("downSLot=" + i + " itemName=" + itemstack.getUnlocalizedName()); inventario.add(itemstack); } } System.out.println("\n\n"); inventario.add(magazine); System.out.println("inventario.size()=" + inventario.size()); System.out.println("\n\n"); nbttaglist = new NBTTagList(); for (int i = 0; i < inventario.size(); ++i) { ItemStack itemstack = inventario.get(i); NBTTagCompound temp0 = new NBTTagCompound(); if (itemstack != null) { System.out.println("upSLot=" + i + " itemName=" + itemstack.getUnlocalizedName()); itemstack.writeToNBT(temp0); nbttaglist.appendTag(temp0); } } System.out.println("Out nbttaglist.tagCount()=" + nbttaglist.tagCount()); tagCompund.setTag("Inventory", nbttaglist); gun.setTagCompound(tagCompund); int hand = playerIn.inventory.currentItem; //playerIn.replaceItemInInventory(hand, null); } return false; } // ####################################################################################3 what this does is first take the gun from the entity, read the nbttags an get the inventory from the gun, add this magazine store back the nbttags to the gun the trouble is that when i read again the inventory from the gun, is empty, there is no magazines but i alredy store some magazines, and this code is not trowing any error theories ?? thanks fro reading console out put //first try [19:45:21] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:529]: [19:45:21] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:539]: In nbttaglist.tagCount()=0 [19:45:21] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:551]: [19:45:21] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:554]: inventario.size()=1 [19:45:21] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:556]: [19:45:21] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:567]: upSLot=0 itemName=cargador55645_Standar [19:45:21] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:576]: Out nbttaglist.tagCount()=1 [19:45:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:529]: //second try [19:45:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:529]: [19:45:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:539]: In nbttaglist.tagCount()=0 [19:45:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:551]: [19:45:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:554]: inventario.size()=1 [19:45:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:556]: [19:45:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:567]: upSLot=0 itemName=cargador55645_Standar [19:45:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:576]: Out nbttaglist.tagCount()=1 [19:45:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:529]: //third try the inventory in the gun is still enmpty [19:45:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:529]: [19:45:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:539]: In nbttaglist.tagCount()=0 [19:45:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:551]: [19:45:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:554]: inventario.size()=1 [19:45:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:556]: [19:45:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:567]: upSLot=0 itemName=cargador55645_Standar [19:45:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:576]: Out nbttaglist.tagCount()=1 [19:45:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:529]: [19:45:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.armasdefuego.cargador55645.cargador55645:itemInteractionForEntity:529]:
  7. good days (broken englis advertisment) im triying to do a graṕling hook that allow to go down and up from clifs, actually most of the code works but i have and undesired behaveour when the player is hanging form the actualy invisible rope it begins to bounce up and down erratically, the other ting is im jumping from a 17 blcks tower and the rope is 10 blocks long so when i relese the rope i fall 7 blocks and die like if jumped from heigther of 17 blocks so i wass thinking first lets add to entityes the feather fall spell, but idont know how * how do you add the feather speel from code ? then i think if a made fly the player in this stance in this resting point, bu dont have any idea * how do you set fly in minecraft ? then think again if i create a invisible block in this point for the player to stand but discarted inmediatly becoze i could shoot downwards what do you think thanks for reading
  8. on 1.8 i do in the part when the arow hits the target if (entityX instanceof EntityLivingBase) { EntityLivingBase mob =(EntityLivingBase) entityX; mob.addPotionEffect(new PotionEffect(Potion.poison.id, 200)); } and there is, poison per 10 seg but only works if server side
  9. i get something float mobHealth = mob.getHealth(); float mobMaxHealth = mob.getMaxHealth(); if (headShootEnable) { boolean HS = true; // dont heatShoot anything whith more health than a witch if (mobHealth > 26.0F) { HS = false; } float mobHeigth = mob.height; // dont heatShoot anything to Small like pigs or childs if (mobHeigth < 1.0F) { HS = false; } if (HS) { Double mobposY = mob.posY; Double mobHead = ( mobposY + mobHeigth ) - (mob.height / 5); Double nextPosX = this.posX + this.motionX; Double nextPosY = this.posY + this.motionY; Double nextPosZ = this.posZ + this.motionZ; double longitud0 = (double) MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); float angulo = (float) ((Math.atan(this.motionY / longitud0) * -1) * 180.0D / Math.PI); double mobdX = this.posX - mob.posX; double mobdZ = this.posZ - mob.posZ; double longitud1 = (double) MathHelper.sqrt_double((mobdX * mobdX) + (mobdZ * mobdZ)); // tang(x) * CA = CO double altura = (Math.tan(Math.toRadians(angulo)) * -1) * longitud1; double alturax = (altura + this.posY); // System.out.println("alturax="+alturax); if (alturax >= mobHead) { System.out.println("HeadShoot"); damageM = damageM * 1.5F; } } } if (damageM > 26.1F) { damageM = 26.1F; } i make this an gonna test it if i dont like it i repost the question for now itake it like solved Thanks
  10. this morning i realize something and make the custom arrow class full of system outs Strength 2.0F [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:161]: inicial arrowHeigth10.520000003278255 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:162]: inicial pitch-0.22247742 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:163]: inicial Yaw90.17516 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:164]: Fuerza inicial2.0 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=0 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=10.520000003278255 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=0.5300112784265364 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.651967810608937 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=1 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=10.508269451717808 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=3.55101266101769 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.6427318662823307 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=2 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=10.446656204816037 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=6.541804058593446 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.6335882813109097 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=3 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=10.335659089050635 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=9.502687570715853 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.624536132102003 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=4 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=10.175771942639278 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=12.433962275954222 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.6155745042988574 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=5 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=9.967483665422174 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=15.335924262095023 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.6067024926882785 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=6 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=9.71127826824579 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=18.208866656049683 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.597919201109195 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=7 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=9.407634921852747 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=21.053079653463307 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.5892237423621385 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=8 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=9.057028005282808 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=23.868850548027325 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.580615238119626 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=9 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=8.659927153789862 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=26.656463760498987 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.572092818837442 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=10 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=8.216797306279739 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=29.416200867430682 [08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.5636556236668033 strength 10F [09:21:52] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2349ms behind, skipping 46 tick(s) [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:164]: inicial arrowHeigth10.520000003278255 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:165]: inicial pitch0.0 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:166]: inicial Yaw90.148315 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:167]: Fuerza inicial10.0 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:355]: [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: updatetick=0 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: worldIn=false [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:359]: arrowHeigth=10.520000003278255 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:360]: arrowX=0.5468684833476746 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:361]: arrowZ=2.6330270612907856 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:355]: [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: updatetick=1 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: worldIn=false [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:359]: arrowHeigth=10.520000003278255 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:360]: arrowX=15.546818415446063 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:361]: arrowZ=2.594198216154918 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:355]: [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: updatetick=2 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: worldIn=false [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:359]: arrowHeigth=10.470000002533197 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:360]: arrowX=30.396768991274136 [09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:361]: arrowZ=2.5557576591001085 [09:22:08] [server thread/INFO]: Saving and pausing game... i create a plain world and build to columns one in the exactly x0 z2 and other at the east in x30 z2 and shoot from the one to the other so at Strength 2.0F (fuerza 2.0F) the arrow has an average speed of 2,89385233 blocks / per tick and gravity is like −0,23032027 blocks / per tick at Strength 10F speed like 14,997032667 blocks / per tick gravity −0,025 blocks / per tick so fuck up this shit gravity is not constan depends on the strength so no Parabolic Motion is usable thirth try is a fail four try witchcraft i gonna need witchcraft to solve this
  11. your rigth but nop dont ge it public void onUpdate() { super.onUpdate(); System.out.println("updatetick="+updatetick); System.out.println("arrowHeigth="+this.posY); updatetick ++; } and I shoot to the sky [23:11:14] [Client thread/INFO]: [CHAT] Player28 has just earned the achievement [Taking Inventory] [23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=0 [23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=69.52000000327826 [23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=1 [23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=75.23358706154791 [23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=0 [23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=69.52000000327826 [23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=2 [23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=80.84003830297883 [23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=1 [23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=75.11943529452965 [23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=2 [23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=80.61287628552385 [23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=3 [23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=86.34042508471765 [23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=3 [23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=86.00138291825259 [23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=4 [23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=91.73580805034982 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=4 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=91.28600453529778 [23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=5 [23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=97.02723723703498 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=5 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=96.46777998582554 [23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=6 [23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=102.21575218157123 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=6 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=101.54773773052023 [23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=7 [23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=107.3023820253986 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=7 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=106.52689594546916 [23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=8 [23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=112.28814561855252 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=8 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=111.40626262500851 [23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=9 [23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=117.17405162257779 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=9 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=116.18683568354066 [23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=10 [23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=121.96109861241338 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=10 [23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenaria But this goes In the part that does the damage when the arrows hits something float mobHealth = mob.getHealth(); float mobMaxHealth = mob.getMaxHealth(); if (headShootEnable){ Double arrowHeigth = this.posY; Double mobHeigth = mob.height + mob.posY; Double mobposY = mob.posY; Double mobHead = mobHeigth - (mob.height /5); System.out.println("arrowHeigth"+arrowHeigth); System.out.println("mobHeigth"+mobHeigth); System.out.println("mobposY"+mobposY); System.out.println("mobHead"+mobHead); if (arrowHeigth >= mobHead) { System.out.println("HeadShoot"); } } and i put this in the constructor i use to shoot the arrow //#########################################################################################################################3 // este es el methodo que uso para lanzar las flechas public flechaMercenariaVainilla_entity(World worldIn, EntityLivingBase shooter, float p_i1756_3_, boolean vallesta) { super(worldIn); this.renderDistanceWeight = 10.0D; this.shootingEntity = shooter; this.thisId = this.getEntityId(); this.shootingEntityId = shooter.getEntityId(); if (shooter instanceof EntityPlayer) { this.canBePickedUp = 0; } this.setSize(0.5F, 0.5F); this.setLocationAndAngles(shooter.posX, shooter.posY + (double) shooter.getEyeHeight(), shooter.posZ, shooter.rotationYaw, shooter.rotationPitch); if (!vallesta) { this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); } this.posY -= 0.10000000149011612D; this.setPosition(this.posX, this.posY, this.posZ); this.motionX = (double) (-MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI)); this.motionZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI)); this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI)); this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); Double arrowHeigth = this.posY; System.out.println("inicial arrowHeigth"+arrowHeigth); } //#########################################################################################################################3 shooting to visual head [23:27:58] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:158]: inicial arrowHeigth70.52000000327826 [23:27:58] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:158]: inicial arrowHeigth70.52000000327826 [23:27:58] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:659]: arrowHeigth70.52000000327826 [23:27:58] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:660]: mobHeigth70.95000004768372 [23:27:58] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:661]: mobposY69.0 [23:27:58] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:662]: mobHead70.56000003218651 shooting to the belly of the same mob [23:28:02] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:158]: inicial arrowHeigth70.52000000327826 [23:28:02] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:158]: inicial arrowHeigth70.52000000327826 [23:28:02] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:659]: arrowHeigth70.52000000327826 [23:28:02] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:660]: mobHeigth70.95000004768372 [23:28:02] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:661]: mobposY69.0 [23:28:02] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:662]: mobHead70.56000003218651 shooting to their feets [23:28:06] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:158]: inicial arrowHeigth70.52000000327826 [23:28:06] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:158]: inicial arrowHeigth70.52000000327826 [23:28:06] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:659]: arrowHeigth70.52000000327826 [23:28:06] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:660]: mobHeigth70.95000004768372 [23:28:06] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:661]: mobposY69.0 [23:28:06] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:662]: mobHead70.56000003218651 this value arrowHeigth 70.52000000327826 is the same value than the initial arrow heigth there must be something reseting this value but whaever it does just when hits something is late tired twomorrow i shall continue Thanks for the tip
  12. Good days this is mi mod http://www.curse.com/mc-mods/minecraft/228033-mercenarymod lately i been working in mi arrows and 45bullts and i wanna make the hits on the head of an entity critical (Damagex2) i learn i could get the aparently heigth of a mod whith float mheigth = mob.getHeigth(); the code is not exact becose im not in the computer whith the code using the mob heigth i decide than if an arrow hits in 1/5 upper part of mobheigth then its headShoot and do damage x2 and whits begin the trouble how do i know the exact heigth of the arrow when reach the hiting box from a mob first try using in the OnUpdate() method when the arrow does the damage, i ask for the value of this.posY() andcompare it to mob.getHeigth(); but fail cos the value of this.posY() only updates once every tick but most of the times the arrow reach the target in less than a tick so the resulting value is the same arrow starting posY second try using maths i could calculate the heigt of the player crosshair at the position of the mob, but this in unuseful becose arrows move in Parabolic Motion and the starting position of the arrow is not the eyesigth of the player so lets say i aim the player crosshair to the head of a zombye at 10meters like 30feets and i shoot an arrow at the fully strength of 2.0F, the cross hair aim to the zombyes head but the arrow hits at their legs so this cannot be consider for a head shoot thirth try lets say i get the arrow heigth at the distance of the target entity using math from the Parabolic Motion of Projectiles but at how is equivalent the 2.0F streng of the arrow , but im pretty sure its not to 2m per second the other thing is the gravity value from the minecraft world ¿9.8 blocks per second some help some ideas ? thanks for reading .
  13. based only in mi personal experience i could say -you have not register the arrow entity in the tracking entitys (Dont doid it just make it worst) -you are shoting two arrows one in the server side and one in the local side and the one from the local side is the one bouncing back to fix this i have to add in the code of the onUpdate() a pieze of (chapuza) to kill the local side arrow only when hit some entity, and there is other problem that hapens when you break the block where the arrow hits, soo i have to add another (chapuza) to kill the server side arrow only when hit a block an enter in onground state and thast only two of the troubles you gonna get
  14. thats bad so the only generic logical way to do this is forget about search in the mob slots, and create some quiver + bow to store the arrows as an NBT in the bow or make the entityes shoot infinity i dont like that idea
  15. Good Nigths im triying something messy to fix this trouble, and the trouble is mi guns dont work went hold by entityes http://www.curse.com/mc-mods/minecraft/228033-mercenarymod what i got done, actually experimenting whith the basic wooden bow, when you swing or rigth click, this bow spawn an ghost entity that first check if the holder of the bow is a valid player or any other entity if is a player it does nothing just let the bow works like always, but if this is a mob, a villager or any other entity the ghost triger the bow animation, thigthen and shoot and arrow based of what kind of arrows the entity has in its inventory. and thats the point i get stuck entityes has a basic inventory but im realize not how to get the inventory size, im prety sure squeletons zombyes and mi custom entity has a base of only 5 slots the method : playerIn.inventory.getSizeInventory() only works on EntityPlayer but not in entityLivingBase so ican't not use it to get the size i need size to make a loop to check all the invetory slots once i get the size either way i think i could use entity.getCurrentArmor(slotIn) or entity.getEquipmentInSlot(slotIn) to check the slots in search for bullets or arrows thanks for your help
  16. God days [broken english advertisment] well im working again in the entityes for mi mod and i want to given the hability to use mi custom fireguns or bows, http://www.curse.com/mc-mods/minecraft/228033-mercenarymod but to make mi guns/bows shoot you must held rigth click and its shoots frm the item.class onUsingTick() method i alredy learn how to make the custom entity to swing an item, is realy easy just to add an entity.swingItem(); inside the public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_){} method, and i been using that to trigger the gun shoot but idont have idea how to make it actually use the item as a rigth click, i know is posible becose the entiies from the little maid works that way here is an example of mi working the trouble here is i have to make three diferent p90 guns * the first is the version for the player that shoot while i held rigth click during the onUsingTick() method from the item class, * the second is for mi mob in this case has a yunno gasai skin this p90 shoots on onEntitySwing(). * and the last is the version to use whith little maid mod, this one shoots onPlayerStoppedUsing(). the last two has been set to shoot in semiautomatic 3 bullets burst, and actually: - the critical parameter that make the bulets make double damage in one of ten shoots works, - the damage based on type of munition works there is 3 type of munition for p90 gun - but the part of the code that make a bullets pierce througt an entity and damage the next entity is not working i fix that later i get lost in the topic. wath i need is to make mi custom entity (yunno) able to hold rigth click (or set item in use) per 30ticks then release as works for the little maid mod mobs this shall allow this custom entity to shoot vainilla bow and bows/guns for other mods, once i have this working ill fix the code for mi guns to have just one version of every gun compatible whith players, mi mobs and little maids, and any other mob entity able to do the same. sorry for the bad english thanks
  17. well i get it 9minecraft is bad and should feel bad if the mod get into that place but then how do you expand the popularity of the mod whitout losing control or money ? i been a little away from computer doing some little jobs. now im here again,
  18. ugghhh i dont get the joke but i persive i little flame here but then how is suppose for the ratkids to get the mods
  19. this bother me alot this is mi first mod and i have like 6 months in this thing of make mods, and i can't upload mi mod to pages other than curse http://www.curse.com/mc-mods/minecraft/228033-mercenarymod ¿it has to be whith youtubers thing or popularity or whith what person you must espeak ? [not native english speaker] thanks for help.
  20. ya it works for the paths variables eclipse was using openjdk i change variables to oracle folder andnow its works its feel a little heavy here in fedora
  21. the last command was nesesary before the gradlew eclipse sometimes you end whith this folder empty "/home/usuario/Modding/forge-1.8-1502-modmercenario/eclipse/" that was one of the errors i have in the past and the --refresh argument solve it
  22. good nigths i decide to change mi linux from debian 8 32bits to Fedora22 64bits, and find than elcipse has a new version Version: Mars Release (4.5.0) i been trying to use this, but end whith awkward results i install the oracle java and javac the paths are rigth the kernell is the last avaliable in officiala reps [usuario@localhost ~]$ javac -version javac 1.8.0_51 [usuario@localhost ~]$ java -version java version "1.8.0_51" Java(TM) SE Runtime Environment (build 1.8.0_51-b16) Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode) [usuario@localhost ~]$ uname -r 4.1.3-200.fc22.x86_64 [usuario@localhost ~]$ download the new forge-1.8-11.14.3.1502-src.zip and set up gradlew without erros i use to compile this 3 commands ./gradlew setupDecompWorkspace --refresh-dependencies ./gradlew eclipse ./gradlew clean setupDecompWorkspace eclipse --refresh-dependencies and the eclipse folder is not empty i almost forget ,the error is that wen open elipse and set the worksspace to /home/usuario/Modding/forge-1.8-1502-modmercenario/eclipse in the ecliupse interface all the folders show like empty whith a yellow mark, but in the file explorer i could see all mi mod files at fireup it says "OpenJDK 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release Error: no se ha encontrado o cargado la clase principal GradleStart" the main class GradleStart has not been found or load or something https://drive.google.com/file/d/0B8sU_NyZQBd7YzJTQ3NPRzhPUlU/view?usp=sharing someone could tellmy whats happend or eclipse mars need extra config to works whith minecraft forge ?? thanks for help
  23. I was not aware of this hiden folder in my home i think all the gradlew files was inside the forge source folder thanks
  24. aknowledge tenchi@debian8:~/Modding/forge-1.8-1419-modmercenario$ ./gradlew --stacktrace build FAILURE: Build failed with an exception. * Where: Build file '/home/tenchi/Modding/forge-1.8-1419-modmercenario/build.gradle' line: 18 * What went wrong: A problem occurred evaluating root project 'forge-1.8-1419-modmercenario'. > java.io.EOFException: End of input at line 40905 column 7 * Try: Run with --info or --debug option to get more log output. * Exception is: org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'forge-1.8-1419-modmercenario'. at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54) at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:187) at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:39) at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26) at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:470) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:79) at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:128) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:105) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:85) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:81) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:39) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29) at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50) at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) at org.gradle.launcher.Main.doAction(Main.java:33) at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35) at org.gradle.launcher.GradleMain.main(GradleMain.java:23) at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56) Caused by: com.google.gson.JsonSyntaxException: java.io.EOFException: End of input at line 40905 column 7 at com.google.gson.Gson.fromJson(Gson.java:813) at com.google.gson.Gson.fromJson(Gson.java:768) at com.google.gson.Gson.fromJson(Gson.java:717) at com.google.gson.Gson.fromJson(Gson.java:689) at net.minecraftforge.gradle.user.patch.UserPatchBasePlugin.setVersionInfoJson(UserPatchBasePlugin.java:145) at net.minecraftforge.gradle.user.patch.UserPatchBasePlugin.applyPlugin(UserPatchBasePlugin.java:46) at net.minecraftforge.gradle.common.BasePlugin.apply(BasePlugin.java:154) at net.minecraftforge.gradle.common.BasePlugin.apply(BasePlugin.java:49) at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:110) at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:69) at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:35) at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:117) at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:36) at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:85) at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:130) at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:41) at org.gradle.api.Project$apply$0.call(Unknown Source) at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34) at org.gradle.api.Script$apply$0.callCurrent(Unknown Source) at build_4v3jl7rlnsjdu837bkm6l5ce5k.run(/home/tenchi/Modding/forge-1.8-1419-modmercenario/build.gradle:18) at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52) ... 34 more Caused by: java.io.EOFException: End of input at line 40905 column 7 at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1377) at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:538) at com.google.gson.stream.JsonReader.skipValue(JsonReader.java:1209) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:170) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:187) at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:172) at com.google.gson.Gson.fromJson(Gson.java:803) ... 54 more BUILD FAILED Total time: 5.643 secs tenchi@debian8:~/Modding/forge-1.8-1419-modmercenario$
  25. from two days ago i could not compile mi mod to test it progress its stuck whit this error tenchi@debian8:~$ cd Modding/forge-1.8-1419-modmercenario/ tenchi@debian8:~/Modding/forge-1.8-1419-modmercenario$ ./gradlew build FAILURE: Build failed with an exception. * Where: Build file '/home/tenchi/Modding/forge-1.8-1419-modmercenario/build.gradle' line: 18 * What went wrong: A problem occurred evaluating root project 'forge-1.8-1419-modmercenario'. > java.io.EOFException: End of input at line 40905 column 7 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 10.403 secs this is debian linux kernel 3.16.0-4-686-pae java version "1.7.0_80" javac 1.7.0_80 when it says : * Where: Build file '/home/tenchi/Modding/forge-1.8-1419-modmercenario/build.gradle' line: 18 the line 18 from build.gradle says "apply plugin: 'forge'" soo i get extressed and update java and javac to the last version i found in oracle the 1.8.0_51 but still give the same error at compiling so i download the last version of forge the 1499 and get this just in the seting up tenchi@debian8:~/Modding/forge-1.8-1419-modmercenario$ cd .. tenchi@debian8:~/Modding$ cd forge-1.8-1499-src/ tenchi@debian8:~/Modding/forge-1.8-1499-src$ chmod +x gradlew tenchi@debian8:~/Modding/forge-1.8-1499-src$ ./gradlew setupDecompWorkspace --refresh-dependencies FAILURE: Build failed with an exception. * Where: Build file '/home/tenchi/Modding/forge-1.8-1499-src/build.gradle' line: 18 * What went wrong: A problem occurred evaluating root project 'forge-1.8-1499-src'. > java.io.EOFException: End of input at line 40905 column 7 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 35.589 secs so i get the same error in a clean minecraft ################################################################## Whay coulbe happen is an gradlew bug ?? is something fixable ?? or just wait until they fixit
×
×
  • Create New...

Important Information

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