#Detect Client Breaking Blocks
36 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
show your code
what's your goal? why do you need to detect if the client is breaking a block?
just to trigger something on the client without a bunch of network events
alternatively, can I detect a native mc packet with NetworkEvents?
you need to tell us your real problem, listening to real network events looks a bit off
The XY problem is when you really want to do X, and you think that Y can achieve X. However, you can't get Y to work, and so ask for help exclusively about Y.
This can lead to a lot of confusion from the people trying to help you, as Y can seem like a very random thing to want to do, and a lot of the time isn't the best way to achieve X anyway.
Its fine to ask about Y, just always include some context about X so you can be put on the right track if Y won't do X well, or there is an easier way to do X.
I want to implement a veinmine system with kjs just for fun
but sending a network event to the client every time it breaks a block seems silly
when i should just be able to detect it on the client
ok, ignore what i said about netowrk stuff
all i want to do is detect, on the client, when i break a block
see if the client is using a keybind to know if I should veinmine
what is?
all i want to do is detect, on the client, when i break a block
i will launch my instance to check that, it should work, if not it is a bug that needs to be fixed
so, 1.20.1 and latest Rhino/KubeJS?
yes, it is not working, I think I know what it is, going to try to fix here and PR
meanwhile you can use forge event
ForgeEvents.onEvent("net.minecraftforge.event.level.BlockEvent$BreakEvent", (event) => {
if (!event.level.clientSide) return
console.log(`Block: ${event.state.block.id} was broken!`)
event.player.tell(`Block: ${event.state.block.id} was broken!`)
Client.isKeyDown(86) && event.player.tell("And was broken holding V key")
})
but this will make players and servers needed to have synced files