Connector icon indicating copy to clipboard operation
Connector copied to clipboard

AdventureZ prevents player from swimming

Open YShadowMY opened this issue 1 year ago • 32 comments

Mod Name

AdventureZ

Mod Homepage

https://www.curseforge.com/minecraft/mc-mods/adventurez

Minecraft version

1.21.1

Describe the bug

while the player is in the water, he cannot move in any direction

Steps to reproduce

  1. download Connector, AdventureZ + dependencies
  2. create a new world
  3. try swimming in the water

Logs

https://gist.github.com/YShadowMY/08c11f64e718f8210532fcd341af4a3e

Additional context

No response

YShadowMY avatar Aug 18 '24 14:08 YShadowMY

Same exact problem with UselessReptile... Player Can't move in water. (everything else works, AFAIK).

Tursiops-G avatar Aug 18 '24 15:08 Tursiops-G

confirmed bug.

Cixon avatar Aug 19 '24 02:08 Cixon

this also happens with betterend and its dependencies.

starrysais avatar Aug 19 '24 02:08 starrysais

this also happens with betterend and its dependencies.

i would open a separate ticket for this !

Cixon avatar Aug 19 '24 03:08 Cixon

This also happens with betterend and its dependencies.

Had this same issue. It was just better end for me. It also affects all mobs. which was super odd watching pigs drown and fish just float in one spot.

JalinRio42 avatar Sep 13 '24 13:09 JalinRio42

bump

Cixon avatar Sep 13 '24 23:09 Cixon

bump

bump are not useful, the dev work on something else for now so just wait

coco875 avatar Sep 13 '24 23:09 coco875

I got a work around. -Disable the problem mods and create a new world -Check swimming works -Save and exit -Enable the problem mods -Load back into new world you created -Should be able to swim with the problem mods

SmexyJesse avatar Oct 17 '24 03:10 SmexyJesse

yeah but not an ideal work around. for modpack creators, downloaders expect things to just work.

I got a work around. -Disable the problem mods and create a new world -Check swimming works -Save and exit -Enable the problem mods -Load back into new world you created -Should be able to swim with the problem mods

Cixon avatar Oct 17 '24 04:10 Cixon

yeah but not an ideal work around. for modpack creators, downloaders expect things to just work.

I got a work around. -Disable the problem mods and create a new world -Check swimming works -Save and exit -Enable the problem mods -Load back into new world you created -Should be able to swim with the problem mods

yeah but this information can help people who wanna play their own mod packs and help devs locate the cause of the bug.

SmexyJesse avatar Oct 17 '24 04:10 SmexyJesse

I think I've found the variable that needs to be fixed, it's in the world file level.dat, which you can edit with NBTExplorer.

You don't need to close Minecraft for this process, just quit your world and do the following.

  • Open NBTExplorer
  • Select the world in which you can't swim, go to level.dat > Data > Player > attributes
  • There should be a few entries, and one of them contains id: neoforge:swim_speed
  • So, in this entry, double-click on base: 0 and replace it with base: 1 Image
  • Save
  • Check if this has solved the swimming problem

Atrimilan avatar Oct 19 '24 14:10 Atrimilan

Tried the NBTExplorer trick, No joy. The id: neoforge:swim_speed attribute tag entry didn't exist. Tried creating/saving it, but it gets overwritten/deleted when subsequently reloading the modified world save.

Note: this is using Useless Reptile 0.8.3-1.21.1 (Fabric mod).

Tursiops-G avatar Nov 05 '24 19:11 Tursiops-G

Yes, I added Useless Reptile and other mods, and my workaround no longer works...

I also have another bug, probably related somehow, when I fly in creative mode and I change handheld item, the gravity reactivates and I can't fly anymore (I have to switch to spectator mode to reactivate it).

I don't have AdventureZ, but I have BetterEnd, BetterNether, Useless Reptile, RPG Series mods, and other small mods.

Atrimilan avatar Nov 05 '24 22:11 Atrimilan

I think I've found the variable that needs to be fixed, it's in the world file level.dat, which you can edit with NBTExplorer.

The in-game command equivalent would be /attribute <username> neoforge:swim_speed base set 1.0, but that didn't work for me either.

unilock avatar Nov 06 '24 22:11 unilock

I think I've found the variable that needs to be fixed, it's in the world file level.dat, which you can edit with NBTExplorer.

The in-game command equivalent would be /attribute <username> neoforge:swim_speed base set 1.0, but that didn't work for me either.

This method (the command) is actually successful in resolving the issue for the mod I'm trying to use at least. Thank you for sharing it. Edit: Although it should be noted that this only resolves the issue for the player, not other non-aquatic entities.

cocoa005 avatar Nov 06 '24 22:11 cocoa005

I've created a workaround in the form of a mod: https://github.com/unilock/sinytra1343

All it does is make LivingEntity#getAttributeValue, when its parameter is NeoForgeMod.SWIM_SPEED, always return 1.0.
Note that this will obviously break other mods that may change that attribute's value, but at least it restores vanilla behavior.

unilock avatar Nov 08 '24 20:11 unilock

I've created a workaround in the form of a mod: https://github.com/unilock/sinytra1343

All it does is make LivingEntity#getAttributeValue, when its parameter is NeoForgeMod.SWIM_SPEED, always return 1.0. Note that this will obviously break other mods that may change that attribute's value, but at least it restores vanilla behavior.

goated. i will need to try it in my modpack to see if there’s any strange behaviors

Cixon avatar Nov 08 '24 21:11 Cixon

I've created a workaround in the form of a mod: https://github.com/unilock/sinytra1343

All it does is make LivingEntity#getAttributeValue, when its parameter is NeoForgeMod.SWIM_SPEED, always return 1.0. Note that this will obviously break other mods that may change that attribute's value, but at least it restores vanilla behavior.

Swimming seems to work fine with your workaround in my local world, thanks 😄.

Atrimilan avatar Nov 08 '24 22:11 Atrimilan

I also have another bug, probably related somehow, when I fly in creative mode and I change handheld item, the gravity reactivates and I can't fly anymore (I have to switch to spectator mode to reactivate it).

In case anyone else is having the same flying issue in creative mod, simply update @unilock's workaround like so :

return attribute.is(NeoForgeMod.SWIM_SPEED::is) || attribute.is(NeoForgeMod.CREATIVE_FLIGHT::is) ? 1.0D : original;

You'll still lose your flight when changing handheld items, but you'll be able to fly again without changing game mode.

Atrimilan avatar Nov 08 '24 22:11 Atrimilan

hey @unilock is it possible for you to make a mod/patch for issue #1435 ? I reached out to mod creator of Legacy 4J and they mentioned that connector is not allowing the nametag rendering.

Please and thank you for everything!

Cixon avatar Nov 10 '24 09:11 Cixon

hey @unilock is it possible for you to make a mod/patch for issue #1435 ? I reached out to mod creator of Legacy 4J and they mentioned that connector is not allowing the nametag rendering.

Maybe you can try updating the code by changing the neoforge:nametag_distance ?

Because without any mod, I get: Image And with betterend, etc. I get 0.0.

I've seen this property here too : https://nekoyue.github.io/ForgeJavaDocs-NG/javadoc/1.20.6-neoforge/net/neoforged/neoforge/common/NeoForgeMod.html#NAMETAG_DISTANCE

Maybe you can simply edit the unilock workaround to something like the following:

        if (attribute.is(NeoForgeMod.SWIM_SPEED::is) || attribute.is(NeoForgeMod.CREATIVE_FLIGHT::is)) {
            return 1.0D;
        } else if (attribute.is(NeoForgeMod.NAMETAG_DISTANCE::is)) {
            return 64.0D;
        } else {
            return original;
        }

I don't know if it's actually the affected attribute, I haven't tried it yet.

Atrimilan avatar Nov 10 '24 10:11 Atrimilan

I've updated my mod to only activate when the detected attribute value is 0.0 (so it may be slightly more compatible with other mods), and to account for NeoForgeMod.NAMETAG_DISTANCE (returns 64.0) and NeoForgeMod.CREATIVE_FLIGHT (returns 1.0 if the LivingEntity is a Player and the player is in creative mode).

You can download it here: https://github.com/unilock/sinytra1343/releases/tag/1.1.0

unilock avatar Nov 10 '24 11:11 unilock

goated. for now, i'm trying to help the community get BetterEnd stuff to work, i have a fix... but i need help. https://github.com/Sinytra/Connector/issues/1331#issuecomment-2467050681

Cixon avatar Nov 11 '24 01:11 Cixon

I've updated my mod to only activate when the detected attribute value is 0.0 (so it may be slightly more compatible with other mods), and to account for NeoForgeMod.NAMETAG_DISTANCE (returns 64.0) and NeoForgeMod.CREATIVE_FLIGHT (returns 1.0 if the LivingEntity is a Player and the player is in creative mode).

Swimming bug fix Confirmed working w/ Useless reptile (Using Latest Neo & FFAPI as well)... Thank you very much for your work on this. :)

Tursiops-G avatar Nov 11 '24 17:11 Tursiops-G

I tried to get Adventure Z to work with newer version of NeoForge for instance 21.1.72 and it won't work. I know for a fact the older NeoForge version it works but something changed. Is anyone else experiencing this?

Cixon avatar Nov 12 '24 01:11 Cixon

I tried to get Adventure Z to work with newer version of NeoForge for instance 21.1.72 and it won't work. I know for a fact the older NeoForge version it works but something changed. Is anyone else experiencing this?

https://github.com/Sinytra/Connector/issues/1527

Cixon avatar Nov 12 '24 02:11 Cixon

I was having this same issue when I updated my server. I was able to fix by running this command "/attribute @s neoforge:swim_speed base set 1"

horse4lunch avatar Mar 30 '25 12:03 horse4lunch

I've updated my mod to only activate when the detected attribute value is 0.0 (so it may be slightly more compatible with other mods), and to account for NeoForgeMod.NAMETAG_DISTANCE (returns 64.0) and NeoForgeMod.CREATIVE_FLIGHT (returns 1.0 if the LivingEntity is a Player and the player is in creative mode).

You can download it here: https://github.com/unilock/sinytra1343/releases/tag/1.1.0

Hi! Just dropping by to share that I encountered the same issue with swimming after installing additional mods besides BetterEnd.

In my case, SWIM_SPEED wasn't 0.0D, but a very low value like 0.07D, which was still breaking swimming movement.

I made a small adjustment to the fix by also handling low values (≤ 0.1D) instead of only checking for exactly 0.0D.

I've tested it and, so far, it seems to have solved the problem for me.

I've also opened a pull request with the improvement in case it helps others. Thanks again for the initial patch!

Image

Maeiro avatar Apr 27 '25 00:04 Maeiro

To those that are not sure whether they're affected by this issue:

You can quickly check your SWIM_SPEED attribute directly in-game while you're in water by running the following command:

/attribute @p neoforge:swim_speed get

If it returns a very low value like 0.07D, that's likely the reason you're unable to swim properly.

Ideally, it should be closer to 1.0D for normal swimming behavior.

If you see a low value, the fix I suggested (handling values ≤ 0.1D instead of only 0.0D) should solve the problem.

Maeiro avatar Apr 27 '25 00:04 Maeiro

In my case, SWIM_SPEED wasn't 0.0D, but a very low value like 0.07D, which was still breaking swimming movement.

This issue has been accounted for with v1.2.0 of my fix mod :)

unilock avatar Apr 27 '25 12:04 unilock