Defence Stat

Started by Ro... on

Topic category: Help with modding (Java Edition)

Last seen on 05:41, 29. Mar 2024
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Defence Stat

How could i make a defence statistique, that can be upgraded, and will act like this: When the Player is Attacked, if the opponent have 200 of Damage, and the Player 400 Health, the opponant can 2 shot him, so The Damage stats of the player, is substracted to the Player's Defence points, and then, the number that it gives, is the number of HP the Player will lose, if it gives a negative number(mean the Defence is lower than Damage) like: 20-41=-21, do Damage + 21.

Last seen on 05:41, 29. Mar 2024
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Anyone?!?
Sun, 05/23/2021 - 00:48

Anyone?!?

Last seen on 21:02, 30. Jun 2023
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
not possible without code
Sun, 05/23/2021 - 02:38

not possible without code

Last seen on 16:36, 14. Sep 2022
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you could make a defense nbt…
Sat, 06/05/2021 - 13:24

you could make a defense nbt tag and before damage heal the player by the defense, if the number is negative set it to attack

Last seen on 05:41, 29. Mar 2024
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank You to replying, hmm,…
Tue, 06/08/2021 - 00:03

Thank You to replying, hmm, how can i do that, can you explain me please!?

Last seen on 17:15, 28. Mar 2024
Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah, that explanation…
Tue, 06/08/2021 - 23:04

Yeah, that explanation sounds a little bit confusing but it also sounds like it could work, could you explain better?

Last seen on 15:22, 28. Mar 2024
Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can totally do this with…
Sun, 12/26/2021 - 19:21

You can totally do this with an NBT tag as eggnirmoll said. Just set the Number NBT to the affected entity and then with the Global Trigger "Entity Attacked" use the "amount" dependency located in the right-down corner. Just double-click the amount dependency, and it will set a block with that dependency on screen to use. This has stored the damage received before its applied to the attacked entity. Just do "Set health of provided entity to [amount - (DefenseNBT)]"
That should work, i can maybe try it myself as i'm creating accesories that reduce damage taken. If it works with that, it would definetely work with an NBT in the middle

Last seen on 12:26, 28. Mar 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Did it work? I'm attempting…
Tue, 07/19/2022 - 02:07

Did it work? I'm attempting this