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


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

BliX5's Achievements

Stone Miner

Stone Miner (3/8)



  1. I'm trying to make a GUI display when you press a key. So far I have the keybind ready, but I'm trying to get the GUI to work. Is there a way to create a TileEntity without connecting it to a block or a workaround for making a standalone GUI? Thanks in advance.
  2. Game blocks hits, hits that do hit have incorrect damage. I will try this
  3. I want cancel the ClickEvent event if the player is on attack cooldown, which I did, but if you click during attack cooldown, the game stores what that hit would have been and makes the next hit that energy, decreasing the attack strength for the final hit. In short, spam clicking will stop the player from spam hitting, but does lower damage, which isn’t what I want. I need a workaround for this
  4. Yes, I know, but this is also the event I want to cancel, which is what I need help with.
  5. I’m not looking for the last attacked entity, I’m looking for the entity the player is currently attacking, and I assumed it could do that.
  6. Originally I just wanted to make an event that cancelled a player's hit when they were on attack cooldown, as part of my combat system. But when the player did hit, it continued the cooldown and canceled the damage like intended, but the damage the target took when the player made a full hit was based on the first hit during cooldown, which meant if you spam clicked, you're full hit would do less damage, which was not what I wanted. Here's the code I made previously that did this: @SubscribeEvent public static void onClickEvent(InputEvent.ClickInputEvent event) { Minecraft mc = Minecraft.getInstance(); PlayerEntity player = mc.player; if (event.isAttack()) { float cooldown = player.getCooledAttackStrength(0); if(cooldown < 1) { event.setCanceled(true); } } } I tried to fix this myself by taking the target and cooldown and adding extra damage, which was obviously a mistake because it overcomplicated the code and it ended up not working anyways.
  7. Will a static field work in transferring information between two client events? Edit: Tried it, AttackEntityEvent is still called late like I explained earlier, despite having a higher priority.
  8. No, I'm saying that the client needs information from the server before the server can detect it, which is my point. Edit: I think you misunderstood what I meant. The server event is called after the client event, so when the player hits, the client calls the server for the entity it's attacking, and of course, since the server is late, the client will finish it's process with null and the previous information is left for the next hit. Whatever entity the player is currently attacking or last attacked.
  9. Tried it, but since ServerEvents are called after ClientEvents, it stores the target too late for the client event to register it on the first hit. In other words, it will damage the target of the previous hit instead of the current hit.
  10. How would I find the entity the player is attacking client side? I've been searching for the past day and couldn't find anything.
  11. I'm using ClickInputEvent so that I can cancel an attack cooldown entirely, instead of just the damage the attack does. In other words, I need to detect the client-side left click, not just the attack.
  12. I'm making an event that detects a player attack, which all works well. Now I need to detect the entity the player is attacking. I tried doing this with getLastAttackedEntity, but it always returns null for some reason. Here's the event I have: @SubscribeEvent public static void onClickEvent(InputEvent.ClickInputEvent event) { PlayerEntity player = Minecraft.getInstance().player; if (event.isAttack()) { BotwMod.LOGGER.debug(player.getLastAttackedEntity()); } }
  • Create New...

Important Information

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