Jump to content

DavidM

Members
  • Posts

    1830
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by DavidM

  1. AFAIK there is no proper way of doing so. One wild idea would be to create a custom implementation of LightTexture, and override LightTexture#updateLightmap to take your custom potion effect into account. Then use reflection to change the lightmapTexture field in GameRenderer (from the field gameRenderer in the Minecraft instance from Minecraft#getMinecraft) to an instance of your own LightTexture. However I am sure this will break many things and might not work as intended. Personally, I would just use the normal night vision effect.
  2. Try subscribing to AttackEntityEvent. AttackEntityEvent fires before the cool down reset. Overriding IForgeItem#onLeftClickEntity should also work.
  3. My bad. Just checked and realized LivingDamageEvent is triggered after calculations, but before the damage applies. It is probably triggered after the ticksSinceLastSwing is reset to 0.
  4. LivingDamageEvent is triggered before the attack deals damage. LivingDamageEvent#getSource returns the damage source, which, if is an instance of EntityDamageSource (when an entity inflicts the damage), will record the entity that dealt the damage, and can be obtained with EntityDamageSource#getTrueSource. If the return entity is an instance of EntityPlayer, you can get the attack cool down with EntityPlayer#getCooldownPeriod or EntityPlayer#getCooledAttackStrength.
  5. Depending on how you want to implement such behavior, there are multiple ways of doing so. One example can be found here (not so well written in my opinion but is the best I could find) : https://github.com/Ellpeck/ActuallyAdditions/blob/master/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java.
  6. ...wut? Nononononono. 1. Try with a VPN. 2. Get a better (faster) internet connection.
  7. Is such fields only used in client-side render calculation?
  8. An Entity contains properties such as posX, posY, rotationYaw, rotationPitch, etc. However, such fields also have "prev" counterparts like prevPosX and prevRotationYaw. What is the purpose of such "prev" fields?
  9. Please be more specific. What packet? Vanilla or modded? On the client side or server side?
  10. Check out the code for AbstractHorseEntity. When in doubt, always read the source code. Don't rely on tutorials.
  11. Doing so is highly discouraged, as this provides cheating potential.
  12. I am creating a way to render multiblock structures in the world. I am planning to write a custom multiblock container, but I am not sure whether there is already a multiblock storage, in which case I shouldn't reinvent the wheel. Is there already a way of storing multiblock structures?
  13. The I'm afraid your modpack won't launch. Try removing mods until the crash no longer occurs, then add mods back in one-by-one until you find the culprit(s).
  14. Please only make one thread per problem. Please elaborate. I have no idea what you are talking about.
  15. /kill @e [{some params here that specifies squid that I can't recall; look up on the Minecraft wiki}]
  16. If your slingshot act like a bow, it shall extends the bow. There is no point in copying everything again.
  17. @Animefan8888 You're back! @Javisel Post your code. That method gives the percentage of the attack cool down.
  18. EntityPlayer#getCooledAttackStrength.
  19. Please note that items and blocks are singleton. Your method of adding timer won't work as the same timer will be used on all players and all instances of ItemStack with your Item.
  20. Do not use static initializers. Initialize your items and blocks during the appropriate registry events. Please post a GitHub repo of your mod.
  21. That is not going to change anything. Particles must be spawned on the client. If an event on the server is supposed to create particles, the server must send packet(s) to notify the client(s).
  22. Since the CHANCES field is public, is it recommendable to just replicate what ComposterBlock::registerCompostable does and add the entry into the CHANCES field manually?
  23. From the file name of your classes, I can already tell that you are following bad tutorials. Most YouTube tutorials on modding are rather bad as they promote bad coding practices and outdated methods. Please read the common issues and recommendations pinned at the top of this forum to learn how to fix those bad practices. I would suggest to rewrite/refractor your code after that. As for your problem, I don't see that you've added a texture for your block.
  24. Wut? OptiFine is not compatible with Forge in 1.14.
  25. Please keep this forum in English. The installer log is generated in the same directory as the installer.
×
×
  • Create New...

Important Information

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