BliX5
Members-
Posts
57 -
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 (3/8)
0
Reputation
-
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.
-
How to find an entity the player is attacking in an event? - 1.16.5
BliX5 replied to BliX5's topic in Modder Support
Thanks! It works now! -
How to find an entity the player is attacking in an event? - 1.16.5
BliX5 replied to BliX5's topic in Modder Support
Game blocks hits, hits that do hit have incorrect damage. I will try this -
How to find an entity the player is attacking in an event? - 1.16.5
BliX5 replied to BliX5's topic in Modder Support
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 -
How to find an entity the player is attacking in an event? - 1.16.5
BliX5 replied to BliX5's topic in Modder Support
Yes, I know, but this is also the event I want to cancel, which is what I need help with. -
How to find an entity the player is attacking in an event? - 1.16.5
BliX5 replied to BliX5's topic in Modder Support
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. -
How to find an entity the player is attacking in an event? - 1.16.5
BliX5 replied to BliX5's topic in Modder Support
Still confused about how to go about this. -
How to find an entity the player is attacking in an event? - 1.16.5
BliX5 replied to BliX5's topic in Modder Support
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. -
How to find an entity the player is attacking in an event? - 1.16.5
BliX5 replied to BliX5's topic in Modder Support
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. -
How to find an entity the player is attacking in an event? - 1.16.5
BliX5 replied to BliX5's topic in Modder Support
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. -
How to find an entity the player is attacking in an event? - 1.16.5
BliX5 replied to BliX5's topic in Modder Support
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. -
How to find an entity the player is attacking in an event? - 1.16.5
BliX5 replied to BliX5's topic in Modder Support
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. -
How to find an entity the player is attacking in an event? - 1.16.5
BliX5 replied to BliX5's topic in Modder Support
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. -
How to find an entity the player is attacking in an event? - 1.16.5
BliX5 replied to BliX5's topic in Modder Support
Still have no luck in finding any solution. -
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()); } }