Started by
littledude47
on
Topic category: Help with Minecraft modding (Java Edition)
I basically want my item to do more damage if a certain thing happens and can't find out how to do that
Topic category: Help with Minecraft modding (Java Edition)
I basically want my item to do more damage if a certain thing happens and can't find out how to do that
This is possible through procedures, but I guess it would depend on what triggers it.
If you do that certain thing, you could make a new variant of the item that takes more damage but has the same name (or not if you don't want it to have the same name).
So for the procedure you could do <if> [?????] and the outcome would be "remove [item] from player inventory" and "add [more damage item] to player inventory"
If this is not the situation to use if blocks in that way, you could use the global triggers.
that could be useful in a more "exact" type of damage changes but my idea is changing the damage based off the amount of health the entity using it has so that would mean I would have to make about 20 items to perfect it
Sometimes you have to make 20 items to create one item. Such is the way of mcreator.
I feel like it would create a ton of compatibility issues if I were to do so, I might as well just delete what I have of the item
I don't know why these others are telling you crazy ways to go about this. You don't need to create 20 different items to make one item that deals extra damage based on player health. As long as you're good with logic, math, and procedures, you can use the global trigger "on entity attacked" to check if the player is holding your custom item, then use the "deal (number) damage to entity" to deal extra damage on the hit. You can make that (number) vary depending on the player's health (which you can get with the block "get entities health". Doing whatever math you want to alter how much damage is done.
what did I do wrong here?
https://imgur.com/a/dxsaIXX
since the last comment I sent didn't send the image ill just send this
You're close! When two entities are a part of a global trigger, the event/target entity tends to be the one the effect is happening to (in this case, the one being attacked), and the source entity is the one committing the act (in this case, the player holding the item and attacking). So in the Minecraft Components category, grab the "source entity" block, and replace all the event/target entity blocks other than the last one with the "source entity" block.
wait I didn't know a source entity block existed, that changes a lot
ok i'm not sure whats up with it but for some reason it still does nothing, it'll just do the default damage the item has set
Screenshot your new procedure?
it is the exact same as the last one but with source entities instead
https://imgur.com/a/VGnvJDh
Is it supposed to be called by anything external to work? i'm not sure what i'm doing wrong
Use the “send message” block to send a message to yourself (essentially logging the procedure) to test if all values are being set properly, and if the procedure is even running. So send the max health and current health to yourself inside that if block to see if those are correct, and if the statement is even running.
ok I tried that and the procedure I guess just isn't being sent whatsoever, I don't think the actual global trigger is working because even a blank one with only the send message doesn't even work