Welcome on MasterOf13FPS! MasterOf13FPS

Register today or sign up if you are already a member and never miss any cool content again :)

Anyone knows what's wrong about my scaffold spoof ?

H4ckeur

New member
Joined
Oct 26, 2020
Messages
15
Reaction score
1
Points
3
Location
Belgium
I'm coding my client for 1.20. I'm asking help because this wasn't an issue in 1.8. Here is a video clip of the issue

basically when enabling scaffold i'm sending a slot change packet to the slot where blocks are and when disabling i switch back to my current slot
for a note, i cancel all slot change packets that are not sent by the scaffold, meaning myself changing slots won't affect the slot i have server side
you can see that it works, but if i'm not holding a block client side then it does all sorts of weird things like not playing the block place sound, rollbacking and placing blocks wrongly which doesn't make any sense as i'm holding a block server side no matter what? even more nonsense is that in singleplayer it works absolutely fine.

i'm placing blocks using mc.interactionManager.interactBlock which i assume is the equivalent of mc.playerController.onRightClick ?
 
mc.interactionManager.interactBlock is not equivalent to mc.playerController.onRightClick. check what mc.interactionManager.interactBlock does.
use mc.playerController.onRightClick sicne thats what the client uses when you right click to place a block. interactBlock is when you interact with a chest for example.
 
I'm coding my client for 1.20. I'm asking help because this wasn't an issue in 1.8. Here is a video clip of the issue

basically when enabling scaffold i'm sending a slot change packet to the slot where blocks are and when disabling i switch back to my current slot
for a note, i cancel all slot change packets that are not sent by the scaffold, meaning myself changing slots won't affect the slot i have server side
you can see that it works, but if i'm not holding a block client side then it does all sorts of weird things like not playing the block place sound, rollbacking and placing blocks wrongly which doesn't make any sense as i'm holding a block server side no matter what? even more nonsense is that in singleplayer it works absolutely fine.

i'm placing blocks using mc.interactionManager.interactBlock which i assume is the equivalent of mc.playerController.onRightClick ?
the best way is probably, not doing something with packets, actually editing ItemRenderer class is the best way imo
 
Fixed, can be closed.

For anyone wondering how I did, basically I looked what item does minecraft check when determining the result of the place action and figured it was using mc.player.getStackInHand which returns the item you hold in your hand client side regardless if it's different on the server.

Basically I modified the item stack it returns to be the one from my scaffold, then like @monkey said I changed in HeldItemRenderer the item that gets rendered to be the one from my current slot instead of mc.player.getStackInHand (which now returns the block from the scaffold)
 
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top