MinecraftFreecam / Freecam

A highly customizable freecam mod for Minecraft. [Maintiners: @hashalite @MattSturgeon]
https://curseforge.com/minecraft/mc-mods/free-cam
MIT License
73 stars 26 forks source link

Randomly get teleported to 0 0 0 #39

Closed ayeh6 closed 1 year ago

ayeh6 commented 2 years ago

I am not sure how to consistently replicate this, but a lot of times when I enable the camera and move slightly the camera gets teleported to 0,0,0 or other random locations in the world and when you try to move away it puts you back there.

Video of behavior

https://user-images.githubusercontent.com/31869462/175657465-6514aace-e5fa-492f-8243-983546971ce7.mov

Modlist

modlist

hashalite commented 2 years ago

This looks like it's being caused by one of your mods. Can you try removing them one at a time to narrow down the list?

ayeh6 commented 2 years ago

I was able to narrow it down to Xaero's World Map, its not a consistent glitch, but when it happens it happens repeatedly.

ayeh6 commented 2 years ago

Also was able to pinpoint Not Enough Crashes through this log once I tried enabling all except Xaero's World Map

[19:58:06] [main/INFO]: Loading Minecraft 1.19 with Fabric Loader 0.14.7 [19:58:06] [main/WARN]: Warnings were found!

kenshin33 commented 2 years ago

I had a similar problem after updating from 1.1.2 to 1.1.4. Downgrade solved it for me. haven't had the time to investigate further.

hashalite commented 2 years ago

I'm having trouble reproducing this issue. @kenshin33 Are you also running Xaero's Worldmap?

kenshin33 commented 2 years ago

I'm having trouble reproducing this issue. @kenshin33 Are you also running Xaero's Worldmap?

nope, when I tried to deactivate all mods and try them one by one, it didn't happen anymore (on 1.1.4). the mods we have in common (the versions won't match though b/c I'm still on 1.18.2 b/c of create)

the only other mods I have are create lightmatica, worldedit and minihud. (I keep them up todate whith polymMC) Edit: modlist

were491 commented 2 years ago

Have this problem too. In addition sometimes I seem to get teleported and "stuck to" certain entities e.g, minecarts (as if i had spectated e.g, a creeper by middle-clicking).

Mod list (logs):

    - advanced_runtime_resource_pack 0.6.2 via enhancedblockentities
    - architectury 5.12.44
    - boostedbrightness 2.1.2
    - carpet 1.4.79
    - carpet-extra 1.4.79
    - clickthrough 1.19-fabric0.53.3-0.4
    - cloth-basic-math 0.6.1 via cloth-config
    - cloth-config 8.1.77
    - com_github_llamalad7_mixinextras 0.0.12 via cull-less-leaves
    - com_moandjiezana_toml_toml4j 0.7.2 via dynamicfps
    - conditional-mixin 0.3.0 via cull-less-leaves
    - continuity 2.0.1+1.19
    - crowdin-translate 1.4+1.19 via clickthrough
    - cull-less-leaves 1.0.5
    - dark-loading-screen 1.6.12
    - dcch 2.0+1.17
    - dev_isxander_settxi_settxi-core 2.9.0 via zoomify
    - dev_isxander_settxi_settxi-gui 2.9.0 via zoomify
    - dev_isxander_settxi_settxi-kotlinx-serialization 2.9.0 via zoomify
    - dynamicfps 2.2.0
    - enhancedblockentities 0.7.1+1.19
    - extrasounds 2.3.1+1.19
    - fabric 0.58.0+1.19
    - fabric-api-base 0.4.11+e62f51a390 via sodium
    - fabric-api-lookup-api-v1 1.6.7+9ff28f40a9 via fabric
    - fabric-biome-api-v1 9.0.14+b2a4a624a9 via fabric
    - fabric-blockrenderlayer-v1 1.1.18+9ff28f40a9 via fabric
    - fabric-command-api-v1 1.2.6+f71b366fa9 via fabric
    - fabric-command-api-v2 2.1.2+0d55f585a9 via fabric
    - fabric-commands-v0 0.2.23+df3654b3a9 via fabric
    - fabric-containers-v0 0.1.28+df3654b3a9 via fabric
    - fabric-content-registries-v0 3.2.1+07df213ea9 via fabric
    - fabric-convention-tags-v1 1.0.8+37622d24a9 via fabric
    - fabric-crash-report-info-v1 0.2.3+bd0a0d4aa9 via fabric
    - fabric-data-generation-api-v1 5.1.2+a680b9b4a9 via fabric
    - fabric-dimensions-v1 2.1.28+a6d2f785a9 via fabric
    - fabric-entity-events-v1 1.4.16+9ff28f40a9 via fabric
    - fabric-events-interaction-v0 0.4.26+9ff28f40a9 via fabric
    - fabric-events-lifecycle-v0 0.2.26+df3654b3a9 via fabric
    - fabric-game-rule-api-v1 1.0.19+18990361a9 via fabric
    - fabric-item-api-v1 1.5.5+35a03c43a9 via fabric
    - fabric-item-groups-v0 0.3.26+9ff28f40a9 via fabric
    - fabric-key-binding-api-v1 1.0.18+9ff28f40a9 via fabric
    - fabric-keybindings-v0 0.2.16+df3654b3a9 via fabric
    - fabric-language-kotlin 1.8.3+kotlin.1.7.10
    - fabric-lifecycle-events-v1 2.1.0+33fbc738a9 via fabric
    - fabric-loot-api-v2 1.1.1+03a4e568a9 via fabric
    - fabric-loot-tables-v1 1.1.4+9e7660c6a9 via fabric
    - fabric-message-api-v1 1.0.1+513f4a59a9 via fabric
    - fabric-mining-level-api-v1 2.1.11+33fbc738a9 via fabric
    - fabric-models-v0 0.3.15+9ff28f40a9 via fabric
    - fabric-networking-api-v1 1.1.0+442de8b8a9 via fabric
    - fabric-networking-v0 0.3.15+df3654b3a9 via fabric
    - fabric-object-builder-api-v1 4.0.8+9ff28f40a9 via fabric
    - fabric-particles-v1 1.0.8+dc39553aa9 via fabric
    - fabric-registry-sync-v0 0.9.18+23c4cfefa9 via fabric
    - fabric-renderer-api-v1 1.0.8+9ff28f40a9 via fabric
    - fabric-renderer-indigo 0.6.10+5187d39fa9 via fabric
    - fabric-renderer-registries-v1 3.2.18+df3654b3a9 via fabric
    - fabric-rendering-data-attachment-v1 0.3.14+aeb40ebe90 via sodium
    - fabric-rendering-fluids-v1 3.0.7+aeb40ebe90 via sodium
    - fabric-rendering-v0 1.1.20+df3654b3a9 via fabric
    - fabric-rendering-v1 1.10.14+9ff28f40a9 via fabric
    - fabric-resource-conditions-api-v1 2.0.9+e62f51a3a9 via fabric
    - fabric-resource-loader-v0 0.6.1+aeb40ebe90 via sodium
    - fabric-screen-api-v1 1.0.24+f05effafa9 via fabric
    - fabric-screen-handler-api-v1 1.2.7+9ff28f40a9 via fabric
    - fabric-textures-v0 1.0.18+9ff28f40a9 via fabric
    - fabric-transfer-api-v1 2.0.9+e62f51a3a9 via fabric
    - fabric-transitive-access-wideners-v1 1.1.1+9e7660c6a9 via fabric
    - fabricloader 0.14.9
    - ferritecore 4.2.1
    - forgetmechunk 1.0.4-1.18.X-1.19.X
    - freecam 1.1.5
    - ftblibrary 1902.3.9-build.144
    - ftbultimine 1900.3.4-build.58
    - gbfabrictools 1.3.4+1.19 via clickthrough
    - indium 1.0.9+mc1.19.2
    - iris 1.2.8
    - java 17
    - lambdynlights 2.1.2+1.19
    - lazy-language-loader 0.3.1
    - lazydfu 0.1.3
    - litematica 0.12.0
    - lithium 0.8.1
    - malilib 0.13.0
    - memoryleakfix 1.19-0.7.0
    - minecraft 1.19
    - minihud 0.23.0
    - modmenu 4.0.4
    - morechathistory 1.1.0
    - moreculling 1.19.1-0.10.0
    - mousetweaks 2.22
    - no_fog 1.3.1+1.16.5-1.19.2
    - nochatreports 1.19-v1.2.3
    - notenoughcrashes 4.1.6+1.19
    - org_anarres_jcpp 1.4.14 via iris
    - org_jetbrains_kotlin_kotlin-reflect 1.7.10 via fabric-language-kotlin
    - org_jetbrains_kotlin_kotlin-stdlib 1.7.10 via fabric-language-kotlin
    - org_jetbrains_kotlin_kotlin-stdlib-jdk7 1.7.10 via fabric-language-kotlin
    - org_jetbrains_kotlin_kotlin-stdlib-jdk8 1.7.10 via fabric-language-kotlin
    - org_jetbrains_kotlinx_atomicfu-jvm 0.18.3 via fabric-language-kotlin
    - org_jetbrains_kotlinx_kotlinx-coroutines-core-jvm 1.6.4 via fabric-language-kotlin
    - org_jetbrains_kotlinx_kotlinx-coroutines-jdk8 1.6.4 via fabric-language-kotlin
    - org_jetbrains_kotlinx_kotlinx-datetime-jvm 0.4.0 via fabric-language-kotlin
    - org_jetbrains_kotlinx_kotlinx-serialization-cbor-jvm 1.4.0 via fabric-language-kotlin
    - org_jetbrains_kotlinx_kotlinx-serialization-core-jvm 1.4.0 via fabric-language-kotlin
    - org_jetbrains_kotlinx_kotlinx-serialization-json-jvm 1.4.0 via fabric-language-kotlin
    - org_joml_joml 1.10.4 via sodium
    - pride 1.1.2+1.19 via lambdynlights
    - raised 1.1.2
    - settxi-gui-cloth-config 2.9.0 via zoomify
    - skinlayers 1.5.1-mc1.19.1
    - smoothboot 1.19-1.7.1
    - sodium 0.4.4+build.18
    - soundcategories 1.2.4+1.19 via extrasounds
    - spruceui 4.0.0+1.19 via enhancedblockentities
    - starlight 1.1.1+fabric.ae22326
    - viewbobbingmod 1.3
    - zoomify 2.5.1

Mod list (mmc): image

The config options (changed only):

{  
    "interactionMode": "PLAYER",  
    "disableOnDamage": false  
}
hashalite commented 2 years ago

I tried out the modlist @kenshin33 provided with no luck reproducing this

@ayeh6 @were491 - have you been experiencing this in in singleplayer, multiplayer, or both?

were491 commented 2 years ago

Multiplayer, but I don't actually play singleplayer anymore. Also, it seems that resetting interactionMode back to its default value fixes this issue for me, though I may be speaking too soon.

edit: I spoke too soon. It happens with interactionMode at its default value as well.

terminal-cs commented 2 years ago

This happens for me too. i have a very vanilla list of mods installed, it's extremely annoying and happens constantly

hashalite commented 2 years ago

@terminal-cs Does it happen in singleplayer, multiplayer, or both? Do you see any errors in your logs?

terminal-cs commented 2 years ago

@terminal-cs Does it happen in singleplayer, multiplayer, or both? Do you see any errors in your logs?

I've only tested multiplayer, my world is on a little self hosted server I have. Last I saw, no errors popped up with it

uriesk commented 2 years ago

I have this problem too, Sometimes its 0,0,0 and sometimes it teleports the freecam into a random entity, like an item that is going through a water stream far away. I only play multiplayer.

This is my modlist, i'm on 1.19.2 with fabric 0.14.9

image
uriesk commented 2 years ago

After i changed the keybind for freecam to some other key - and changed it back again - this issue is gone. Very strange, but it worked.

hashalite commented 2 years ago

@uriesk @terminal-cs @were491 Is anyone here willing to share the ip of the server they're experiencing this on for testing purposes?

hashalite commented 2 years ago

You can send it to me privately at hashalite@gmail.com

terminal-cs commented 2 years ago

@uriesk @terminal-cs @were491 Is anyone here willing to share the ip of the server they're experiencing this on for testing purposes?

It's a personal server, I don't have it connected to the internet usually. If needed I can use ngrok for you to connect to it

kenshin33 commented 1 year ago

@hashalite happened again (Sometime ago), same client difffrent server (was testing offlinemod). Tried to look, in the logs nothing jumped at me. and it stopped on it's own. IS there anything specific you want me to do/enable -- maybe rebuild the mode -- to try and get more info if it ever happens again?

hashalite commented 1 year ago

@kenshin33 I have still been unable to reproduce this issue, however I have a theory as to what may be causing it. Can you try out this build and let me know if you still experience it? Make sure to give it adequate testing time since it seems to happen so sporadically.

Anyone else who has this issue is welcome to test as well.

freecam-dev-1.1.6.zip

terminal-cs commented 1 year ago

another note is that sometimes the freecam will be locked to a random mob that seems to be out of render distance, and the camera will keep following and rotating to the mob's head

hashalite commented 1 year ago

@terminal-cs Yes, I am aware of this. My theory is that the FreeCamera entity may have the same entity id as another entity in the world, and thus when an entity position packet matching that id is received from the server, it gets applied to the FreeCamera. In the dev build I supplied, I block the handling of any packets that affect the position/rotation of the FreeCamera. Please test it out and let me know if the issue persists.

terminal-cs commented 1 year ago

@terminal-cs Yes, I am aware of this. My theory is that the FreeCamera entity may have the same entity id as another entity in the world, and thus when an entity position packet matching that id is received from the server, it gets applied to the FreeCamera. In the dev build I supplied, I block the handling of any packets that affect the position/rotation of the FreeCamera. Please test it out and let me know if the issue persists.

will do

hashalite commented 1 year ago

@kenshin33 @terminal-cs I'm starting to think the better approach would be to print something every time one of those packets is received, instead of blocking them. This way we can confirm that this is definitely the cause of the issue, because you would receive the message whenever it happens.

Here is a build doing that: freecam-dev-2-1.1.6.zip

hashalite commented 1 year ago

^ You should see the packet type and entity id in chat every time the issue happens if this is the cause.

terminal-cs commented 1 year ago

alright, im going to test rn

terminal-cs commented 1 year ago

^ You should see the packet type and entity id in chat every time the issue happens if this is the cause.

2022-12-07_17 54 02

terminal-cs commented 1 year ago

https://user-images.githubusercontent.com/76945439/206337871-dcf10fb4-0171-4912-b1ff-21c43d71341d.mp4

terminal-cs commented 1 year ago

^ You should see the packet type and entity id in chat every time the issue happens if this is the cause.

2022-12-07_17 54 02

note in this screenshot i was not actualy outside, freecam was teleported there

hashalite commented 1 year ago

@terminal-cs You are only getting the messages when the teleportation happens, correct?

terminal-cs commented 1 year ago

@terminal-cs You are only getting the messages when the teleportation happens, correct?

no, I get a ton of them even when not teleported

terminal-cs commented 1 year ago

@terminal-cs You are only getting the messages when the teleportation happens, correct?

no, I get a ton of them even when not teleported

at least not that I can see, possible that there are minor movements I don't see

hashalite commented 1 year ago

@terminal-cs Can you try out this jar and let me know if you still get messages and if the issue still happens?

freecam-dev-3-1.1.6.zip

terminal-cs commented 1 year ago

@terminal-cs Can you try out this jar and let me know if you still get messages and if the issue still happens?

freecam-dev-3-1.1.6.zip

alrighty

terminal-cs commented 1 year ago

@terminal-cs Can you try out this jar and let me know if you still get messages and if the issue still happens? freecam-dev-3-1.1.6.zip

alrighty

Nothing imediently uppon joining, which is when the issues typicaly occur (but not limited to that) i will play for a bit and see if it pops up at all

terminal-cs commented 1 year ago

After ~1 hour of playing, nothing seems to be teleporting freecam when using it

hashalite commented 1 year ago

@terminal-cs That's a good sign! How often does it typically happen?

terminal-cs commented 1 year ago

@terminal-cs That's a good sign! How often does it typically happen?

When loading into the world, basicly every time freecam is open for about 1 minute then it settles down, i tested 2 times going into freecam right when i got into the game and nothing happened (good). It doesn't happen too often during normal gameplay but when it does it happens a bunch and i have to go into and exit freecam mode many times before it stops teleporting the camera, but with the new jar i have not experienced any teleporting. also question, why does the freecam need to listen for entity movement packets anyways?

hashalite commented 1 year ago

why does the freecam need to listen for entity movement packets anyways?

It doesn't, the game has a ClientPlayNetworkHandler that handles packets, and when an EntityPosition packet is received, it uses the getEntityById() method to decide which entity to apply the position to. If the entity id the server passes is the same as the FreeCamera's, the game applies the position to the FreeCamera.

hashalite commented 1 year ago

I've attempted to solve the issue in the most recent dev build by setting the FreeCamera's entityid to an arbitrary negative number, since the server should never pass a negative entity id.

terminal-cs commented 1 year ago

why does the freecam need to listen for entity movement packets anyways?

It doesn't, the game has a ClientPlayNetworkHandler that handles packets, and when an EntityPosition packet is received, it uses the getEntityById() method to decide which entity to apply the position to. If the entity id the server passes is the same as the FreeCamera's, the game applies the position to the FreeCamera.

ahh, that makes sense.

terminal-cs commented 1 year ago

I've attempted to solve the issue in the most recent dev build by setting the FreeCamera's entityid to an arbitrary negative number, since the server should never pass a negative entity id.

do -1

hashalite commented 1 year ago

do -1

I chose -8008135 for the dev build, but that would probably be the more professional option

hashalite commented 1 year ago

@terminal-cs Im gonna leave this open for a day or two longer to allow for enough testing, and if nobody has any issues by then, I'll consider it solved and push the changes to main.

terminal-cs commented 1 year ago

@terminal-cs Im gonna leave this open for a day or two longer to allow for enough testing, and if nobody has any issues by then, I'll consider it solved and push the changes to main.

sounds good, thanks for (hopefully) fixing the issue

hashalite commented 1 year ago

Should be fixed in 1.1.7