[SOLVED]Help with Critical-hit and Crit-damage system

Started by Lord Makishi on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[SOLVED]Help with Critical-hit and Crit-damage system
Tue, 01/10/2023 - 18:49 (edited)

Hey there! I have been trying to make a critical hit system in Mcreator, that has a chance to deal a critical hit when attacking, based on the crit-chance of the attacker minus the crit resistance of the attacked. I also made crit-dmg, which is damage added on top of the attackers damage based on the crit-dmg of the attacker minus the crit-def of the attacked. And while all this sounds logic in theory, in practice it totally doesn't work for me. I don't know if it's the formula I'm using or not but I'm concerned that it doesn't work. Could anyone help me please?

https://imgur.com/a/J5Lyfmf

https://imgur.com/a/ucewAI3

https://imgur.com/a/HNnZNxf

https://imgur.com/a/dXiskFl

Thanks in advance!

Edited by Lord Makishi on Tue, 01/10/2023 - 18:49
Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
2 advices do it with player…
Sun, 01/08/2023 - 08:06

2 advices 
do it with player lifetime variables

typically crit is 150% or 200% of normal damage, if you don't have any coding experience, the easisest way to do it is; apply +2 strength potion levels to achieve the crit damage effect for 3 ticks in the when player hits entity. 

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@masterkostas Thanks for the…
Sun, 01/08/2023 - 14:22

@masterkostas Thanks for the advices! The only reason i used scoreboards instead of global variables, is because I thought they only apply to players and not other mobs. And while the strength effect is a good idea, I do still want it with a certain percentage since I'm also trying to add armor sets that boost these crit stats, similar to many RPG games I've played.