Right Click happens twice?

Started by ItsJustKen on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Right Click happens twice?

https://imgur.com/a/ZAuR4IC

I made a simple procedure that plays one of multiple sounds on right click with a cool down.
But whenever I right click, it plays two of the sounds THEN cools down, which leads me to believe it's registering two clicks in rapid succession before cooling.

Is there any way besides what I've done to only allow ONE input?

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You need to put the entire…
Thu, 04/11/2024 - 13:27

You need to put the entire procedure in an "if" block, then attach a "not" block, then "is provided world client-side" That fixes a lot of glitches, including double click registration.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The double click problem is…
Sat, 11/30/2024 - 04:02

The double click problem is because it's doing it client and server at the same time, single player still as a server, this does create alot of problems

Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Silly question Catnip, by…
Tue, 12/31/2024 - 14:10

Silly question Catnip, by doing the check "if provided world not client side", I understand this ensures the procedure executes server side, BUT will it not affect the procedure at all? I guess it is not recommended in all cases? 

Thanks for the clarification

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I should have said that it…
Tue, 12/31/2024 - 14:25

I should have said that it works in many cases, but there are some procedure blocks that run on client-side only that won't work if you specify server-side in the way that I wrote it.

It is usually fine, because many block, item, world, and entity procedure blocks can work very well on server-side only, and it automatically is synchronized with client-side. And that running them on both client-side and server-side will cause it to appear repeated, but also create 'ghost' effects in the second repetition.

However, there are some procedure blocks that only work on client-side, although I think that they are usually marked, one major exception is the movement vector procedure block set, which can only be used for players on client-side.

Overall, I would recommend using the check that I wrote about in an earlier comment for most procedures, especially if 'ghost' effects are happening. However, if some parts of your procedure stop working at all or seem to work weirdly, my advice would be to experiment with removing the if block from the procedure, or moving it to only cover a small part of the procedure that suffers from 'ghost' effects.

To clarify, by 'ghost' effects, I mean potion effects that endlessly remain at 0 seconds, invisible blocks that knock you back when you touch them, blocks changing what type they are when you click on them, items that disappear, or fire that causes no damage. In most cases, those are fixed by running the procedure server-side only.

Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for the detailed…
Wed, 01/01/2025 - 15:24

Thanks for the detailed answer Catnip, helped a lot clarify a couple of things!
I was doing my research not only on client/server side procedures but also client/server side TRIGGERS, which I'm still trying to fully undestand, dont know if you are familiar with it.
One example of what I'm saying would be: 
Having a SERVER side only TRIGGER, which modifies entity nbt, however, since it would show the message "Block entity_nbt is not synced between the client and server automatically" would I still need to do the check "if provided world not client side" to get it to work despite the trigger already being server side? Hope that made sense, so things like that I am still experimenting and figuring out.
Thanks again Catnip, and Happy New Year to everyone! :D

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If a trigger specifies that…
Wed, 01/01/2025 - 15:37

If a trigger specifies that it is client-side or server-side, then you do not need to use a procedure to ensure that it is server-side, as if it is a server-side trigger, ensuring that it runs server-side only is unnessecary, and if it is a client-side trigger, it cannot run server side, so attempting to force it to do so will only cause it to not work. I hope that helps to clarify some.

As for the nbt blocks, I personally just use nbt on server-side by using server-side triggers or using conditions to ensure that it runs server-side only. There is a downside to that which is that if the nbt is changed on server-side only, attempting to use it for a client-side purpose, such as displaying text, could cause it to display things incorrectly, but I usually just avoid cases where I would need to use nbt on client-side, that way I can just use server-side. That is just my personal uses for nbt data, and it maybe isn't always the best strategy, but I normally just ignore the warnings that it isn't automatically synchronized between client-side and server-side and I use it mostly server-side only.

Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
About the triggers, that…
Wed, 01/01/2025 - 17:48

About the triggers, that makes a lot of sense, however, I'm experiencing some weird stuff while testing these two procedures:
PROCEDURE 1 (gives an extra life to your pet):
https://imgur.com/a/u3HoZbl

PROCEDURE 2 (when said pet is supposed to die, it uses their extra life preventing the event):
https://imgur.com/a/c52IyTz

1. I've noticed despite Procedure 1 having a server-side trigger, the procedure is executed both client and server-side (or at least the play sound block is, since duplicated sounds happen)

2. Particles and sound should run ONLY when said pet consumes their extra life so they don't die, however PROCEDURE 2 is incapable of spawing particles at all (which is weird since its trigger is client and server-side), BUT here's the main issue, when I use the check to ensure PROCEDURE 1 runs server-side (despite it not needing it since its trigger is already server-side only), particles in PROCEDURE 2 indeed spawn, but NOT when their pet consume their extra life, but when they permanently die meaning when they don't have any extra life.

Hope this wasn't that confusing, but decided I would let you know just in case there was something obvious going on that I was not aware of. If you need more info about it let me know but I would like to read your take on this, i'm gettin dizzy :s