Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/02/18 in all areas

  1. Use Minecraft.getMinecraft().player To get an EntityPlayer instance since you are client side only this will work. Then you have to get the pieces of armor that the player is wearing there is a method for it and it takes in a EntityEquipmentSlot parameter.
    1 point
  2. Keeping MCreator-generated code in private to stay secure.........................................
    1 point
  3. This happens because if the damage is 0 then EntityLivingBase#attackEntityFrom will return false which will cause the arrow to "bounce". You can have the exact same effect if you shoot the player in creative mode. You might be able to circumvent the issue by using a LivingHurtEvent(or LivingDamageEvent) in combination with ProjectileImpactEvent. Basically in the impact event do your arrow check and if it is supposed to have no damage set some kind of flag to true(somewhere in your code that is) and also store the entity reference of the entity being damaged(that's important)(you may store something to identify the entity by, like it's UUID instead of a direct reference). Next in the Hurt/Damage event check for the flag - if it's true check whether the entity being damaged is the one you've stored the reference to(it should be but there are edge cases where it may not be). If it isn't set the flag to false, clear the reference and return. If it is you have a jackpot - set the damage to 0, flag to false, clear reference and be done. Alternatively don't clear the reference, but store it as a UUID to not leak like half of the game. I've just tested this idea and it works flawlessly. Here is the code I've used. private static boolean checkImpact = false; private static UUID hurtID = null; @SubscribeEvent public static void onArrowDamage(ProjectileImpactEvent event) { checkImpact = false; if (event.getEntity() instanceof EntityArrow && event.getRayTraceResult() != null && event.getRayTraceResult().typeOfHit == RayTraceResult.Type.ENTITY) { checkImpact = true; hurtID = event.getRayTraceResult().entityHit.getUniqueID(); } } @SubscribeEvent public static void onHurt(LivingHurtEvent event) { if (checkImpact) { checkImpact = false; UUID id = event.getEntityLiving().getUniqueID(); if (id.equals(hurtID)) { event.setAmount(0); } hurtID = null; } } Now admitedly you shouldn't have to store the entity reference, since the code flow should take you directly to the LivingHurtEvent from the ProjectileImpactEvent(in this case) but you never know with all the forge re-implementations around like them spigots and stuff. Since I can't guarantee the code flow within those implementations it's better to be sure.
    1 point
  4. Ya, sadly it was the latter. So I spent a week or so re-writing everything he has done and getting it working. FG is functional, it needs some quality of life stuff, but it's done enough where I am back working on patch updates in Forge. Now my job is working through the massive crapton of patches that Forge has. My current 'old' directory: Forge is building fine. I finished that up last week. We just arnt publishing to the main download page because we don't want end users downloading things yet. As it's still being worked on. As for other things, cpw has work to do on ModLauncher/FML stuff. And he won't have time to work on that until chirstmas vacation because of real work. But, he is being kind enough to take time out from having with his kids for christmas to do some work on Forge. So Ya... things are being done, you can see what what is being done by watching the git repos. Things are out far enough where modders can start testing things. Giga has some stuff to do to make the MDK a bit more userfiendly. Stuff is progressing, and we're not hiding it. There is no ETA or percentage complete because those are literally impossible to calculate because we are working on things as they come up.
    1 point
  5. Weird. There are five things things that can go wrong, and I think you've covered them already: 1) lang file name is not capitalized properly according to the format. You're already aware of that, but just to check I would put two copies of your lang file in your assets, one with en_us.lang and en_US.lang, and see if that works. 2) lang file is in wrong directory. Your directory tree seems correct. Are you seeing it in your IDE properly or just in your file directory -- need to make sure the file is considered part of the project. May want to refresh or even re-run gradlew eclipse, confirm build path, etc. 3) your modid doesn't match for some reason. If your other assets work, then I guess that is correct. 4) your item unlocalized name doesn't match an entry in the .lang file. Is there something weird about the way you're setting or retrieving the unlocalized name for your items -- like could there be a weird unprintable character in it or something? 5 your .lang file has a weird character or unnecessary space (a space after the = will kill the matching). If you save the .lang file as UTF-8 make sure you choose option to save with BOM (byte-order mapping) or it won't be read properly.
    1 point
×
×
  • Create New...

Important Information

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