Started by
AetherDarkosZak
on
Topic category: Help with modding (Java Edition)
So I am new using Mcreator and I was trying to learn as much as possible by myself.
I was trying to create a weapon with a chance of hitting more damage.
I created variables(numbers) to give more damage or more chance if some condition happen
I only have problems when I use the "Deal damage to entity" procedure, when I put in the amount of damage a variable sometimes I hit an absurd amount of damage. But when I put a normal number like "10" it functions as intended. Is it impossible to do this with variables? or I am doing something wrong. Also I saw in the code that by default the "deal damage to entity" procedure expects a "float" but my variable is a "double".
What are your random numbers? (What are the Max and Min values?)
hi
Zachmine I was using this for tests:
If Random [0,1) < 0.5
But my idea was to use something like this:
Set Global: Chance to: 0,18
If Random [0,1)< Get Global: Chance
Try adding the procedure with the "send message to chat" and announce the Chance value whenever the "Deal damage to entity" procedure block is called.
I think that the chance works but my problem was that when using variables in the deal damage procedure it works randomly. Sometimes it just not works or do a lot of damage(1 shot a whiter boss)
There is another way to use a random value: "if Random = Number, damage entity by 6." And repeat for every random damage number that you want:
"if Random = 1, damage entity by 6."
"if Random = 2, damage entity by 7."
"if Random = 3, damage entity by 8."
It might be tedious, but it will certainly work.
Also, is there any easy way to see the the damage I deal to a mob ? I was testing with the send message and get health of entity procedures
I can't think of any immediate way to do it with procedures. There is a mod called damage indicators if we want to be lazy: https://www.curseforge.com/minecraft/mc-mods/torohealth-damage-indicators
So here is my code. If someone can explain to me what is wrong I will be greetly appreciated.
https://imgur.com/a/5ZvjOMj
Also, sorry for my english
Your English is pretty good by the way!
I cannot see anything wrong with the procedure immediately.
Maybe you can brute force the number to something reasonable by dividing the aditionaldamage by 10.
Thanks!
I did a test and this is my results.
https://imgur.com/a/ePYlULu
I think that the problem is the deal damage procedure but i dont know a way to make it work as intended
You multiplied the Value by 10, and divided it by 10, effectively not changing your procedure at all.
:shrug:
Remove the " * 10" and it should be good.
Keep the " / 10"
I would like to tell you that it work but it just keep dealing 6.5 damage. However when I multiplied the value by 100 the damage was about 120 so I will be testing more tomorrow
Alright, cya for now!
If you do want to keep talking with me about this tomorrow, I urge you to contact me through Discord (since there is a lot of back and forth here).
The Discord server link on my account bio should allow you get my contact my directly.
Now, if you don't have Discord/don't want to talk about this tomorrow, that's alright.