#I opened a thread, so itll be easier
1 messages · Page 1 of 1 (latest)
So basically, I'm trying to make sure that the player can't break any blocks, but also he won't see the "crack" animation
I don't want to just do event.isCanceled(true);
Oh okay
if you'll check what mining fatigue -1 in 1.8 does, it let's your player hand move as if he doesn't have any fatigue, but he doesn't see that he damages the block
This way I could just send him a packet with the block crack animation and control the mining speed, without mining fatigue -1.. it becomes trikier
Yeah
I mean that sounds reasonable
Tho I wonder if you could use PlayerInteractEvent
but else injecting a packet listener which listens for outgoing and incoming packets could be ideal as it’d give you more control at the disadvantage of being less safe
That's what I'm trying to do at the moment, currently I'm listening to ArmAnimation packet event (every time the player's hand moves) check which block he is looking at and then sending him a 0 crack animation (which is the first crack animation but I'll change it to -1 which removes the crack animation in general)
with this, the player keeps on mining the block normaly but the crack animation flickers between the client crack animation and the packet crack animation
Yeah I knew another way of doing it
Which worked fine
Tho I’m not at home rn, so you’ll have to wait for that a bit in case you don’t solve it by then
do you know when you'll be home? just want to know if I should keep trying or just wait a bit lol
Nope not really sry
I see, I'll keep trying and wait, thanks!
That's the first thing I did, the thing is that it cancels server side, so the client will break the block but it'll cancel the block break
it's like canceling BlockBreakEvent
Well did it cancel the animation?
Nope..
Ah that’s a pity
yep lmao
Maybe you could manipulate this through nbt?
Idk
Cuz I believe the client initiates the animation regardless
So it is bound to be hacky unless you’ve set for instance mining fatigue or other predetermined factors maybe?
Yeah I though that maybe it could be a solution since in adventure mode you can put nbt that lets you mine, haven't worked with nbts yet though
That is what I'm thinking, in 1.8 mining fatigue -1 did the trick, tried using mining fatigue -1 in 1.18 it gave me mining fatigue 1 lol
tried that as well XD it just made my hand disappear since 255 just makes the animation like x1000 slower lol