Started by
EtsuEunji
on
Topic category: Help with MCreator software
So i added an effect on the right click of the swords that adds a potion effect to the player. The problem comes when i try to use the effect again, it doesn't work.
There is another post with the same problem and although i followed the procedures in the same way it still doens't work
Can you show your procedure?
https://imgur.com/a/jYRry7P
Are you right clicking in air or block?
i'm using the right click in air
Then as long as you are not clicking it on a block it should work
However, try to make If statement that will gonna check if Entity that uses it is entity player
with the procedure: is current entity (sub) type of entity player?
The only thing that I can see that might be wrong is that you are using the double == sign instead of the single one. Unlike in programming where = is for setting a variable and == is for comparing, in the procedures = is also for comparing and == includes metadata. My guess is that because you deal damage for the sword and ALSO check for meta data, it specifically checks whether you have the sword + in its full health state in your hand, where as if you'd only have 1 = it would only check for the sword and possibly not the durability state?
But this is just a guess honestly.
At least, that would explain why it only works the first time as with the meta data at first the sword is in full durability state thus the == metadata corresponds.
Try hitting a mob with your sword. If the potion no longer works (thus even not the first time) now the durability has been altered, then you know to change it to the single = sign.
thanks, i'll try that :0
it was that, thank so much