Started by
I Love Mcreator
on
Topic category: Help with Minecraft modding (Java Edition)
I wanna make a hammer that does 3x crit damage + sound + cooldown but i ahvent found a way. 1. I can't use the trigger in the item cuz idk how to override crit damage + it cant specify if its a crit. cant use when player crit cuz what if the weapon's in teh offhand, or if its in offhand + weapon in main hand? cant use entity is attacked or before entity attacked cuz no crit detector and latter doesn't exist anymore
hm.. Dunno if that's really helpful, but I have used some Stats in a mod i worked on.
First, i had created Global Variables : CritDMG[Persistent, Player] , CritRate[Persistent, Player]
(This is used only to check and set/update the Player's Crit Rate and Crit DMG in my case.)
Then, on the first sword i made, i created a procedure upon hitting an enemy to calculate the Damage. HOWEVER, the sword itself has damage set to 0.1. (not 0 because it just won't land hits)
The procedure is briefly going like this :
WEAPON TRIGGER: [When this item hits another entity]
If [Random 0,1] =< [var CritRate / 100]
do
[Deal (DMG + (DMG * (var CritDMG / 100))) Damage to Provided Entity]
else
[Deal (DMG) to Provided Entity]
Basically, setting that 0.1 damage on the Item itself will rend its damage completely useless even if it would crit due to doing literally nothing. In your case, you would surely set CritDMG to just be a x3 DMG addition or something.
I don't believe we can change Minecraft's original Critting or Damaging, therefor, i made it useless and forced my way in with this. Hoping this can help you!~
i figured out how. I just used player performs critical hit trigger( which is a lie its whenever player hits in general) and if its a crit, i change damage multiplier to triple and play the sound with particles. You cant use a melee attack in off-hand