Skip to content

Conversation

mynameisbob1928
Copy link
Contributor

Type of change

  • Bug fix
  • New feature

Description

This checks for if freecam is enabled and then uses MinecraftClient.crosshairTarget (which is already modified in a mixin) instead of raycast. This does limit it so that you can only tp to blocks that are targeted so you can't tp to a block 30 blocks away (This does not affect use while not in freecam).

While searching issues I did see two other pull requests that did implement a raycast method to get around the aforementioned limitation which may be better to use than this: 4549 and 4146

Related issues

#2775

How Has This Been Tested?

Tested in singleplayer and a public muliplayer server

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

HitResult hitResult;

if (Modules.get().get(Freecam.class).isActive()) {
hitResult = mc.crosshairTarget;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raycast from the freecam position

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in any case, we are probably going to be merging #4549 to add freecam compat to clicktp

@Wide-Cat Wide-Cat closed this in 7d489bc Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants