Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

EscapeMC

Forge Modder
  • Posts

    337
  • Joined

  • Last visited

Everything posted by EscapeMC

  1. Yes i do, I want the armor to disappear along with the player. So is what I have (sort of) correct? Or what exactly need I do to get this? adding mc = new Minecraft(); gives an error, and I am really not sure on what to do. Really, what is the needed plan for me to be able to get the player and the armor invisible.
  2. No, I wish to change the model of the armor while the player is wearing it. So, maybe from all black to all white. No crafting changes, just changing the model. Also one more question, I am trying to use the variable Minecraft in a method, and whenever I put it inside of my method (onItemRightClick), it gives me the error of "The method onItemRightClick(ItemStack, World, EntityPlayer, EnumHand, Minecraft) of type Bell must override or implement a supertype method" How would I solve this, without removing the @Override annotation? Or would I just not be able to do that, as i am not making a custom method? EDIT: Fixed that part. Never mind it. I have this @Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) { if(playerIn.inventory.armorItemInSlot(3) != null && playerIn.inventory.armorItemInSlot(3).getItem() == ModItems.wraithHelmet && playerIn.inventory.armorItemInSlot(2) != null && playerIn.inventory.armorItemInSlot(2).getItem() == ModItems.wraithChestplate && playerIn.inventory.armorItemInSlot(1) != null && playerIn.inventory.armorItemInSlot(1).getItem() == ModItems.wraithLeggings && playerIn.inventory.armorItemInSlot(0) != null && playerIn.inventory.armorItemInSlot(0).getItem() == ModItems.wraithBoots) { // playerIn.addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("invisibility"), 1000, 1)); if(isVis = false) { isVis = true; }else if(isVis = true) { isVis = false; }else{ System.out.println("Failed to Vis"); } itemStackIn.damageItem(1, playerIn); } changeVis(mc); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, itemStackIn); } public void changeVis(Minecraft mc) { if(isVis = true) { mc.thePlayer.setInvisible(false); System.out.println(isVis); System.out.println("Should be False"); }else if(isVis = false){ mc.thePlayer.setInvisible(true); System.out.println(isVis); System.out.println("Should be True"); } if(mc.thePlayer.capabilities.disableDamage = false) { mc.thePlayer.capabilities.disableDamage = true; }else if(mc.thePlayer.capabilities.disableDamage = true) { mc.thePlayer.capabilities.disableDamage = false; } and when I right click this item I get the crash of
  3. Anyone Please? I really want to get this.
  4. This would be an issue for the mod devs, not here. Plus not to mention that your server is running Cauldren
  5. Hello! First off, if you refuse to help me due to this request being in 1.10.2, I understand. I really shouldn't be asking about this version but I like this version and do not wish to move up as packs I am making are in this version. Now, if you're still around, thank you! What I am trying to do is make a set of armor that has a texture, but then on a key-bind give you a potion effect and also change the armor texture. So, my question is: How would I make a set of armor and an item, that upon wearing the full set, holding an item, and right-clicking the item, would change the armor model and give the potion effect, until the item is right-clicked again, in which it would turn off the potion effect and revert the armor model back to its original? If you need any clarification as of what I mean, please ask as that may be a bit confusing. Lastly, two things. One, no I am not asking you to spoon-feed me this information. Maybe a reference to keybindings and testing for all armor on an item would be great, or maybe instructions on how to do this specific task. Two, thanks to all who read this far and are willing to help me!
  6. Alright, so smite me if you must, but I am making somewhat of a hacked client! Now, I am trying for an xray module, so I figured I could come here anyway. But, if you wish for me not to, just tell me to not ask about this stuff here! So, I have the whole module, but the only thing is the block brightness. Anyone know how I can make it so that the blocks appear to be super bright (at least see-able) and not just black blocks, no difference unless there is light touching the blocks directly? Thanks if you can help, and if you need more info, just ask, please!
  7. If I am correct, this is due to your internet connection. I have been on good internet (aka, unblocked) and bad internet (aka, school internet) I get the weirdest errors on bad internet, and I have seen this (a very similar error at least) on the bad internet. Sorry to say this, but ya. Internet problems, ugh! There are so many domains too for all of the modding stuff (git, maven, etc) that I could never pinpoint them all that I needed to give to my school to unblock for the internet. Good luck in your search in solving this error!
  8. What exactly are you looking for your "moving parts" to do? Are you just having a changing texture or what, moving arms?
  9. Look at your transferStackInSlot and mergeItemStack. If you'd like, you can look to my Git for Thing's Mod. I use a right clickable chest-like item thing, and you can reference the transferStackInSlot and mergeItemStack. Ask if you need more help.
  10. Well, we don't have access to all of your code. Care to post any of it so we can actually help you?
  11. First of all, please don't just post complete solutions without any explanation besides "do this". It helps nobody. Apart from that, you are unnecessarily wrapping everything in ItemStacks. Thank you diesieben07 for your help, and yah, I agree, someone just giving you the code doesn't help anyone. I've solved my problem now.
  12. preInit. Oh, I use my smelting and crafting recipes in the init. Sorry
  13. Nothing yet, I'm not sure where to start. Question, have you even tried looking at the error that the code might give you? Have you tried to run the game once? You have a log from a crash?
  14. If you want example code for an ore, look in my signature for my GitHub on TeamMadness Mod, I made many ores there.
  15. If you're looking to have a block that when destroyed it drops itself, do nothing. If you want this "Copper Ore" to drop "Copper Ingot" when destroyed, use this.getItemDropped(state, rand, fortune) in the block class itself. Is that right diesieben07? If you want a smelting recipe, you need to use GameRegistry.addSmelting in the init.
  16. Ok, so I have never worked with shapeless recipes before, so this was my best attempt: GameRegistry.addShapelessRecipe(new ItemStack(ModItems.team_madness_pickaxe), new Object[] {"RJN", "IAC", " O ", 'R', ModItems.1_pickaxe, 'J', ModItems.2_pickaxe, 'N', ModItems.3_pickaxe, 'I', ModItems.4_pickaxe, 'A', ModItems.5_pickaxe, 'C', ModItems.6_pickaxe, 'O', ModItems.7_pickaxe}); Anyone mind correcting my work? In case you want the log from the crash,
  17. This solved my problem, thank you Draco!
  18. So I have entityarrow.setDamage(damageIn); What is the standard Minecraft Bow damage that I can compare to? (Its not in ItemBow) Also, if I wanted to give this bow more range, entityarrow.setAim(entityplayer, entityplayer.rotationPitch, entityplayer.rotationYaw, 0.0F, f * 3.0F, 1.0F); Do I edit this line? If so, which part? is it the f * X.0F? or just the last variable, X.0F by itself?
  19. So, I am making a custom bow, and I want it to have 1.75 more damage/power. I cannot figure out what I need to do though. Do I need a custom arrow or something? Code for ian_bow: package com.github.escapemc.teammadnessmod.items; import javax.annotation.Nullable; import com.github.escapemc.teammadnessmod.Reference; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Enchantments; import net.minecraft.init.Items; import net.minecraft.init.SoundEvents; import net.minecraft.item.EnumAction; import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.ItemArrow; import net.minecraft.item.ItemBow; import net.minecraft.item.ItemStack; import net.minecraft.stats.StatList; import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundCategory; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ian_bow extends ItemBow { public ian_bow() { setUnlocalizedName(Reference.ModItems.IAN_BOW.getUnlocalizedName()); setRegistryName(Reference.ModItems.IAN_BOW.getRegistryName()); this.setMaxStackSize(1); this.setMaxDamage(1401); this.addPropertyOverride(new ResourceLocation("pull"), new IItemPropertyGetter() { @Override @SideOnly(Side.CLIENT) public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { if (entityIn == null) { return 0.0F; } else { ItemStack itemstack = entityIn.getActiveItemStack(); return itemstack != null && itemstack.getItem() == Items.BOW ? (float)(stack.getMaxItemUseDuration() - entityIn.getItemInUseCount()) / 20.0F : 0.0F; } } }); this.addPropertyOverride(new ResourceLocation("pulling"), new IItemPropertyGetter() { @Override @SideOnly(Side.CLIENT) public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { return entityIn != null && entityIn.isHandActive() && entityIn.getActiveItemStack() == stack ? 1.0F : 0.0F; } }); } private ItemStack findAmmo(EntityPlayer player) { if (this.isArrow(player.getHeldItem(EnumHand.OFF_HAND))) { return player.getHeldItem(EnumHand.OFF_HAND); } else if (this.isArrow(player.getHeldItem(EnumHand.MAIN_HAND))) { return player.getHeldItem(EnumHand.MAIN_HAND); } else { for (int i = 0; i < player.inventory.getSizeInventory(); ++i) { ItemStack itemstack = player.inventory.getStackInSlot(i); if (this.isArrow(itemstack)) { return itemstack; } } return null; } } @Override protected boolean isArrow(@Nullable ItemStack stack) { return stack != null && stack.getItem() instanceof ItemArrow; } @Override public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityLivingBase entityLiving, int timeLeft) { if (entityLiving instanceof EntityPlayer) { EntityPlayer entityplayer = (EntityPlayer)entityLiving; boolean flag = entityplayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantments.INFINITY, stack) > 0; ItemStack itemstack = this.findAmmo(entityplayer); int i = this.getMaxItemUseDuration(stack) - timeLeft; i = net.minecraftforge.event.ForgeEventFactory.onArrowLoose(stack, worldIn, (EntityPlayer)entityLiving, i, itemstack != null || flag); if (i < 0) return; if (itemstack != null || flag) { if (itemstack == null) { itemstack = new ItemStack(Items.ARROW); } float f = getArrowVelocity(i); if ((double)f >= 0.1D) { boolean flag1 = entityplayer.capabilities.isCreativeMode || (itemstack.getItem() instanceof ItemArrow ? ((ItemArrow)itemstack.getItem()).isInfinite(itemstack, stack, entityplayer) : false); if (!worldIn.isRemote) { ItemArrow itemarrow = (ItemArrow)((ItemArrow)(itemstack.getItem() instanceof ItemArrow ? itemstack.getItem() : Items.ARROW)); EntityArrow entityarrow = itemarrow.createArrow(worldIn, itemstack, entityplayer); entityarrow.setAim(entityplayer, entityplayer.rotationPitch, entityplayer.rotationYaw, 0.0F, f * 3.0F, 1.0F); if (f == 1.0F) { entityarrow.setIsCritical(true); } int j = EnchantmentHelper.getEnchantmentLevel(Enchantments.POWER, stack); if (j > 0) { entityarrow.setDamage(entityarrow.getDamage() + (double)j * 0.5D + 0.5D); } int k = EnchantmentHelper.getEnchantmentLevel(Enchantments.PUNCH, stack); if (k > 0) { entityarrow.setKnockbackStrength(k); } if (EnchantmentHelper.getEnchantmentLevel(Enchantments.FLAME, stack) > 0) { entityarrow.setFire(100); } stack.damageItem(1, entityplayer); if (flag1) { entityarrow.pickupStatus = EntityArrow.PickupStatus.CREATIVE_ONLY; } worldIn.spawnEntityInWorld(entityarrow); } worldIn.playSound((EntityPlayer)null, entityplayer.posX, entityplayer.posY, entityplayer.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); if (!flag1) { --itemstack.stackSize; if (itemstack.stackSize == 0) { entityplayer.inventory.deleteStack(itemstack); } } entityplayer.addStat(StatList.getObjectUseStats(this)); } } } } public static float getArrowVelocity(int charge) { float f = (float)charge / 20.0F; f = (f * f + f * 4.0F) / 3.0F; if (f > 1.0F) { f = 1.0F; } return f; } @Override public int getMaxItemUseDuration(ItemStack stack) { return 72000; } @Override public EnumAction getItemUseAction(ItemStack stack) { return EnumAction.BOW; } @Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) { boolean flag = this.findAmmo(playerIn) != null; ActionResult<ItemStack> ret = net.minecraftforge.event.ForgeEventFactory.onArrowNock(itemStackIn, worldIn, playerIn, hand, flag); if (ret != null) return ret; if (!playerIn.capabilities.isCreativeMode && !flag) { return !flag ? new ActionResult(EnumActionResult.FAIL, itemStackIn) : new ActionResult(EnumActionResult.PASS, itemStackIn); } else { playerIn.setActiveHand(hand); return new ActionResult(EnumActionResult.SUCCESS, itemStackIn); } } @Override public int getItemEnchantability() { return 1; } } I feel I should be @Override ing the getArrowVelocity, but I get an error ( The method getArrowVelocity(int) of type ian_bow must override or implement a supertype method ) whenever I add @Override. Lastly, am I doing my numbers right?
  20. Well, they are all registered in order, but that second part is what it is. Thanks!
  21. Ok, so I am trying to get my custom tab to be organized, but I recently added another 2 sets of tools (Sword, Hoe, Pickaxe, Axe, Shovel) and they are all out of order, and jumbled with each other, while all my other sets of tools are organized. Any help on how to organize them/set the order that they appear in the CreativeTab?
  22. So I somehow figured it out myself. Oh well, thanks anyway everyone!
  23. You have a link I can download your mod with, so I can do a time test too? What version?
  24. Well, I couldn't really get too much out of that tutorial for transferStackInSlot, as the method he was doing transferStackInSlot for was a furnace. I couldn't really figure out what I would need to change, delete, and redo from his transferStackInSlot that he gave. Could anyone help me understand what I would need to do with to change it to work with a (large) chest? I don't want copy pasta from you, I would just appreciate you going through this, highlighting things (or something), and telling me what I might need to do with it. Thanks!
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.