Fabric API

Fabric API

106M Downloads

UseBlockCallback called multiple times for one click

phase opened this issue · 6 comments

commented
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.

commented

It's called once on the server and client. Being called twice on each is definitely a bit odd, though.

commented

Once for each hand

commented

Doing a hand & side check made it fire once. Thanks!

commented

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

commented

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.

commented

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