Topic category: Help with MCreator software
So, I've searched far and wide for this:
I know this is a duplicate post, I know someone is going to state that I should read the API reference and come up with my own solution,
but that isn't helpful as it's only led me in circles. So instead; We're going to bud heads and figure this out together for everyone who stumbles on this page.
This will be the page people link to for future duplicate posts.
The version I'm using is 2023.2,
my loader is for Fabric 1.19.2.
This generator was a pain to set up, but yes, the mod I wish to create must be on this version; and made using this generator or one similar to it (if some of you can find one, if you do find one, tell me exactly how to install it, because I feel like plugins are just kinda convoluted to set up for my version.)
Due to this inconvenience, assume which ever solution you give me is for this version, even if it isn't: It'll give me a place to look to and do research and will be just as useful.
Alright, with all of that out of the way, my issue is as follows:
This code damages the player, and I know why it does so, but I cannot get around this problem.
in the iterative loop my statement compares Entity iterator to the event/target entity, which is basically the player in this case.
I understand that normally the solution is to change this out with source-entity, that way the comparison functions properly, but the item I'm making requires the trigger "Player right clicks on entity", which is under the procedure "Player right click (entity pos)" which does not offer "source entity" as a dependency, the reason being damage targeting needs the specification of which entity I'm referring to.
The desired result is: I right click with my chainsaw, I deal 7 damage to the target entity in front of me within a 4-block radius of local: (interaction distance).
The item MUST take 10 durability damage when it attempts this, so I need access to itemstack or an alternative like shown in the picture.
I do not need a cooldown; Minecraft has natural I-frames which limit the damage this thing can deal.
Normally, all the dependencies required to make this happen without issue are:
Itemstack,
entity,
sourceentity,
x,
y,
z,
world,
but unfortunately, there are zero triggers out there that offer all 7 of those at once.