Started by
Jacko22
on
Topic category: Help with Minecraft modding (Java Edition)
I want to have several different effects based around critical strikes in my mod, but I don't know how to affect them. The simplest example is the dagger weapon class, which I want to deal more damage with crits. Would the be possible with the current version of MCreator (and how)?
Honestly, the simplest way i have integrated Crit Damage is via Custom Stats i made.
I don't think we can really affect how the Vanilla Crit damage goes for since it's like a multiplier i believe, perhaps by code, but i can't help with that.
What i've done, is make the melee item cause 0.1 damage (Just so the hit lands, but without hindering your DPS) while the procedure 'Upon Entity Hit with Item' calculates the output of DMG.
I have the following variables : CritRate , CritDMG, PhysicalDMG.
The way i made Crit is simple afterwards..
This is solely for when it DOES crit, assuming the random returns True :
If (CritRate/100) >= Random (0,1) do :
[Deal (PhysDMG + (PhysDMG x (CritDMG/100))) Damage to Entity]
What i'd do in your case would be to naturally give more CritDMG to your Dagger class by default, so they gain advantage upon critting. If you're looking to really use Vanilla Crits, maaaybe there's a way to detect if a player Crits and then add some extra damage freebies. I can't check right now if that's a possibility, else i hope this helped.
That's exactly what I planned to do but it seemed like too much work to apply the system to the vanilla weapons. IDK if it would even be possible.
Kinda unrelated (not sure if it would be better to start a new topic) but do you know if it would be possible to change the health values of vanilla mobs and the player? My current plan would be to multiply the player's health by 5, bosses by about 7.5, and most other mobs by 3-4.
I also kind of did something that could help you with the HPs.
Although it doesn't affect the player, we'd have to pass by with another trigger or something, I tagged 'small mobs' , 'Elites' , and 'Bosses'.
Each mobs 'Upon Entity Spawns' Global Trigger receive a certain amount of Hp Scaling depending on the difficulty world they spawn in. I simply checked:
If entity is tagged as 'modid:Small'
Set attributes [maxHP] to X amount
Set Current Health to [Max Health] for Provided Entity
In your situation, you could probably find out which mob specifically you wanna inflate its HPs and just do [Max HP] x 7.5 for the Ender Dragon, for example. I even changed their Melee DMG to be inflated too, using the same thing, just with an extra block and that's it.
For the player, i guess you can inflate the HP attribute each respawn and each Joining of the world.
Where do you create custom variables /tags? Is it a mod element or do you make it in the procedure screen?
Another thing - not to feel like I'm stealing your work, but do you have any tips on adding the variable based damage system retroactively to vanilla?
I found the answer to my question abt tags and variables.
This should work, right? https://imgur.com/a/TSfonQS
Please! So far the crit system is working perfectly, I just want to know how you apply changes to vanilla items and tags to vanilla mobs. I found how to override vanilla textures but that seems to be the extent of what I can change.
Sorry for the wait!! Omg i feel bad, i was supposed to check on you, hehe~
Alright, so for your question about Vanilla Content, i really don't know if we can modify their DMG output or do anything with them. I've checked through Global Triggers in Procedures, and there is nothing to help such as a "Upon Item hitting Mob". Maybe someone out there knows.
As for your Critting, i think this should work out, but you have set your DMG Dealer with DMG times CritChance. I don't know if that's normal for what you want to do, but you might just want to put a custom modifier, depending on what amount of DMG Boost you want.
Also, upon reviewing, you might want to change your variables as well.
They are currently probably set to "NUMBER" (GLOBAL_MAP). This ties this variable to the MAP itself as a singular number.
You'd probably want to set it to "NUMBER" (PLAYER_PERSISTENT). This ties it to EACH player individually without messing with each others. Persistent will allow it to stay even after Dying instead of reseting.
Don't hesitate if you need something again! Me or other people will probably try to help out still~!
I think I figured how to apply the system to vanilla tools!!
https://imgur.com/a/YqOOgyn
That seems promising!
That might be the most you can do, but if it works, I'm happy!~
Maybe you can create an Item tag rather than test for every swords, if you want to have it simpler down the line. You could then check "Is item in main hand [Is Item tagged as : (X) ]" ?