right click only working once

Started by EtsuEunji on Mon, 10/14/2019 - 22:24

Topic category: Help with MCreator's application

Last seen on 18:04, 17. Oct 2019
Joined Oct 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
right click only working once
Mon, 10/14/2019 - 22:24

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

Last seen on 15:12, 21. Nov 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Can you show your procedure?
Wed, 10/16/2019 - 09:40

Can you show your procedure?

Last seen on 16:29, 20. Nov 2019
Joined Apr 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Are you right clicking in…
Wed, 10/16/2019 - 18:03

Are you right clicking in air or block?

Last seen on 18:04, 17. Oct 2019
Joined Oct 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
i'm using the right click in…
Wed, 10/16/2019 - 18:04

i'm using the right click in air

Last seen on 16:29, 20. Nov 2019
Joined Apr 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Then as long as you are not…
Wed, 10/16/2019 - 18:09

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

Last seen on 18:04, 17. Oct 2019
Joined Oct 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
with the procedure: is…
Wed, 10/16/2019 - 18:37

with the procedure: is current entity (sub) type of entity player?

Last seen on 15:12, 21. Nov 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
The only thing that I can…
Wed, 10/16/2019 - 19:18

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.

Last seen on 15:12, 21. Nov 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
At least, that would explain…
Wed, 10/16/2019 - 19:20

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.

Last seen on 18:04, 17. Oct 2019
Joined Oct 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
thanks, i'll try that :0    
Thu, 10/17/2019 - 17:49

thanks, i'll try that :0

 

 

Last seen on 18:04, 17. Oct 2019
Joined Oct 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
it was that, thank so much
Thu, 10/17/2019 - 18:05

it was that, thank so much