Skip to content

Instantly share code, notes, and snippets.

View TypicalShavonne's full-sized avatar
🎯
Đi học

Pham Nguyen To Minh TypicalShavonne

🎯
Đi học
View GitHub Profile
@nahkd123
nahkd123 / ServerSide_SetCameraEntityS2CPacket.md
Last active April 2, 2024 07:07
The "SetCameraEntityS2CPacket" trick

The SetCameraEntityS2CPacket trick

What is this?

SetCameraEntityS2CPacket is a clientbound packet that will be sent to client when player interacts an entity while in spectator mode. This packet is mainly used for setting the player's camera to entity's position.

The jank: Not in spectator mode

But what if we send SetCameraEntityS2CPacket when player is NOT in spectator mode? Surprisingly, player didn't kick themselves from server, plus their camera is now attached to target entity! The camera behavior is what you would normally expect like spectating mob the normal way (eg: hide hotbars, add linear interpolation to camera). Setting the camera to self (self as in the player whose connection handler is controlling) returns everything to normal. I haven't tested what happens when you set the camera to other players.

Another jank: Player's input

While the camera is attached to another entity, player's input like moving, sneaking, jumping and looking around will still working normally. You can

@Kas-tle
Kas-tle / converter.sh
Last active December 3, 2023 11:05
Java to Bedrock 3D Model Converter 1.1
#!/usr/bin/env bash
: ${1?'Please specify an input resource pack in the same directory as the script (e.g. ./converter.sh MyResourcePack.zip)'}
# define color placeholders
C_RED='\e[31m'
C_GREEN='\e[32m'
C_YELLOW='\e[33m'
C_BLUE='\e[36m'
C_GRAY='\e[37m'
C_CLOSE='\e[m'
@Kas-tle
Kas-tle / converter.sh
Last active December 3, 2023 11:04
Java to Bedrock 3D Model Converter
#!/usr/bin/env bash
: ${1?'Please specify an input resource pack in the same directory as the script (e.g. ./converter.sh MyResourcePack.zip)'}
# ensure input pack exists
if ! test -f "${1}"; then
echo "Input resource pack ${1} is not in this directory"
echo "Please ensure you have entered the filename correctly"
exit 1
else
printf "\e[33m[•]\e[m \e[37mInput file ${1} detected\e[m\n"
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active September 23, 2024 14:40 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export to tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.