Started by
ZarephLae
on
Topic category: Help with Minecraft modding (Java Edition)
So majority of what I want is done.
I have all the procedures made but I don't have them linked to any triggers.
Like I have a procedure that defines how the effect is applied. But I can't add it to the potion effect because it doesn't use source entity.
I made a procedure that defines what this status effect does but I can't add it to the potion effect trigger because it doesn't have source entity triggers.
I need to link them to the effect but I can't. Please help.
Edited by ZarephLae on Mon, 06/19/2023 - 01:34
For your potion effect, what I would do is go to your triggers and make an "On effect active tick" procedure. This will execute code every tick, so a way that I found to be helpful was within the procedure, you can make a timer that applies the effects you desire, allowing you to choose the frequency so that it doesn't damage you every tick. The way you can do this is use an if: do, else statement, and within the if block, grab an equals (=) block from logic. From entity data, grab a Get custom number NBT tag. Set the tag string to "timer". Drag the custom number NBT block into the equals block's first argument, and after the equals, add an integer (0).
Underneath that block, go to entity management and "Set custom NBT tag", string value should be "timer". For the last argument, it requires a number, this will be your number of ticks that it must wait before damaging the player again. I found 50 to work for my effect. Underneath that, apply the logic for damaging the entity/player. Within the else block, Set custom number NBT tag "timer". For the last argument it requires, go to Math and grab the operator block (+) and set it to Subtract. Within the operator's first argument, drag in a "Get custom number NBT tag", and on the last argument, drag in a "1" integer.
What is happening:
As a reminder, this procedure is being executed every tick, and NBT is persistent, so we are using this as a timer as a type of public variable so we can access it to subtract every whatever number of ticks we set, so we can space out the damage. The NBT data is being embedded within the target entity which is whoever has the potion effect. In your case, the player
I hope this makes sense! There honestly may be way better ways to do this, but I was struggling with the same and found that to work
This seems like alot of work for a procedure that already works. I did create an on effect active tick, that's what the second procedure was. But I can't use it because of the source entity tag.
Your solution probably works but it doesn't even mention the mobs in question which is what my effect is for. It's fine though, I'm pretty sure I figured ito out. I used two and statements. One just specifies if the player has the status effect otherwise it won't be enabled.
I take it back, the solution I had isn't working.
So the effect even though it's applied, the mob isn't dealing an additional .5 damage. I was letting a zombie hit me and it didn't deal any extra. I chose Mob entity and also tried monster entity because I want any hostile mob to afflict this, what about those tags is wrong?