getting sword attack damage with procedures

Started by Derpy101 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
getting sword attack damage with procedures

Hey there guys, a new day a new problemb! :D, Its pretty simple if you read the title, I need to get the damage a sword does with a procedure. thats all, Thanks for any help given!

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry, I don't really know…
Sat, 06/18/2022 - 04:12

Sorry, I don't really know what you want to do with that damage so I assume that you gonna just show it in the chat. Anyway, to get the damage you just need to set the trigger to  "entity attacked" and double click the "amount" in the bottom right of the screen. Here's the example:

https://ibb.co/cw3CnDg

Anyway, hope this helps.

Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hmm this would be great but…
Sat, 06/18/2022 - 12:38

hmm this would be great but do you have any way to get it in, When living entity is hit with tool?

Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hmm maybe not let me test…
Sat, 06/18/2022 - 12:39

hmm maybe not

let me test something out

Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah I still need to have it…
Sat, 06/18/2022 - 12:52

Yeah I still need to have it in when living entity is hit with tool, :skull:

Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I got it to work, All I…
Sat, 06/18/2022 - 12:59

I got it to work, All I needed to do was set a variable for the source entity, BTW SOURCE ENTITY IS A PLUGIN, IF YOU FIND THAT THIS IS YOUR SOLUTION, MAKE SURE YOU HAVE THE PLUG IN, IM USING 2021.3 AS OF RIGHT NOW

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm glad it works out for…
Sun, 06/19/2022 - 02:32

I'm glad it works out for you. Btw, I'm using 2022.1 so the source entity already been applied into the workspace. Anyway, good luck on your mod :D

Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
good luck on your mod aswell…
Mon, 06/20/2022 - 14:39

good luck on your mod aswell! :D

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you explain in further…
Sun, 10/20/2024 - 06:31

Can you explain in further detail how you actually got the attack damage of the weapon for the variable?
I've been at this for a while now and can't figure out how to get the attack damage of the item itself, thanks for your time tho

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you use the global…
Sun, 10/20/2024 - 19:00

If you use the global trigger on entity attacked. It will give you the attack damage of the item used. Call the number dependency (amount).

I dont know if this gives you the damage before or after taking into account the entities armor value. If the (amount) is after taking into account the armor then get the armor value and use that to get the original damage.