question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UseBlockCallback called multiple times for one click

See original GitHub issue
UseBlockCallback.EVENT.register((player, world, hand, hitResult) -> {
            System.out.println("hit thing");
});

If I right click a block with an empty hand, this is printed out 4 times. If I place a block, this is printed 2 times. I’m using 19w07a.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
flier268commented, Jun 5, 2019

How do I know that who call UseBlockCallback? (client or server)

world.isClient() will return true if it is on the client, and false on the server.

Thanks a lot

1reaction
Blayykecommented, Jun 5, 2019

How do I know that who call UseBlockCallback? (client or server)

world.isClient() will return true if it is on the client, and false on the server.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jquery .click being called multiple times - Stack Overflow
The click function gets called multiple times when it should only be called once. The commented out code at the end works just...
Read more >
UseBlockCallback (fabric-api 0.34.8+1.17 API) - Fabric maven
Callback for right-clicking ("using") a block. Is hooked in before the spectator check, so make sure to check for the player's game mode...
Read more >
How to prevent a function from being called multiple times?
In this article you'll find out how to use throttle and debounce to prevent the callback or function fired too quickly.
Read more >
Index (fabric-api 0.32.5+local-1.16 API)
Deprecated. Convenience method to add a carver to one or more biomes. ... An event that is called after a mouse click is...
Read more >
Simulink® Release Notes
MathWorks products are protected by one or more U.S. patents. Please see ... Simulink now checks the run-time parameter value of an S-function....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found