#I opened a thread, so itll be easier

1 messages · Page 1 of 1 (latest)

pallid tusk
#

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);

stiff pine
#

Oh okay

pallid tusk
#

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

stiff pine
#

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

pallid tusk
#

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

stiff pine
#

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

pallid tusk
#

do you know when you'll be home? just want to know if I should keep trying or just wait a bit lol

stiff pine
#

Nope not really sry

pallid tusk
#

I see, I'll keep trying and wait, thanks!

stiff pine
#

Still

#

Try cancelling PlayerInteractEvent.Action.LEFT_CLICK_BLOCK

pallid tusk
#

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

stiff pine
#

Well did it cancel the animation?

pallid tusk
#

Nope..

stiff pine
#

Ah that’s a pity

pallid tusk
#

yep lmao

stiff pine
#

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?

pallid tusk
#

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

pallid tusk
stiff pine
#

Yeah

#

Why not just give 255 amplifier?

pallid tusk
#

tried that as well XD it just made my hand disappear since 255 just makes the animation like x1000 slower lol