Skip to content

Instantly share code, notes, and snippets.

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

Typical TypicalShavonne

🎯
Đi học
View GitHub Profile
@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"
@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'
@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