LiveOverflow / minecraft-hacked

Minecraft:Hacked is a video series exploring various technical areas of Minecraft.
209 stars 12 forks source link

Fly episode hack #17

Open zSynctic opened 2 years ago

zSynctic commented 2 years ago

Can you push the fly hack code

zSynctic commented 2 years ago

Figured it out this is the code for the flying boat code:

@Mixin(PlayerEntity.class) public abstract class ExampleMixin1 extends Entity{

public ExampleMixin1(EntityType<?> type, World world) {
    super(type, world);
}

@Inject(at = @At("HEAD"), method = "tick")
private void tick(CallbackInfo ci){
    ClientPlayerEntity player = MinecraftClient.getInstance().player;
    try{
        if(player != null && player.hasVehicle()){
            Entity vehicle = player.getVehicle();
            Vec3d velocity = vehicle.getVelocity();
            double Yaxis = player.input.jumping ? 0.5 : 0;
            vehicle.setVelocity(new Vec3d(velocity.x, Yaxis, velocity.z));
        }
    } catch (Exception e) {
        assert true;
    }
}

}

wizdoux commented 2 years ago

@LiveOverflow please, we want the flyhack mod

CrossScarDev commented 1 year ago

He should just add all of them