Jump to content

FOV change when changing base speed.


AnaRchX

Recommended Posts

Hello,
I am using forge version 36.1.0 for MC 1.16.5 and after experimenting a bit with the code below, it seems that when I change the base value of the Players attribute Movement_Speed directly in my eclipse environment the camera FOV does not change at all but after building the mod and testing it with the same forge version with no other mods installed the FOV is behaving like any moving impairing effect does.

private void onEntityTick (TickEvent.PlayerTickEvent event) {
	PlayerEntity ent = (PlayerEntity) event.player;
	ModifiableAttributeInstance attribute = ent.getAttribute(Attributes.MOVEMENT_SPEED);
	attribute.setBaseValue(0.1D);
} //This code is taken in part of a larger code block from my mod

Could this be a problem with how my eclipse is set up?
Should I use a different method of handling the players speed?
Is there a way to disable the fov change when there is a change in movement speed?
I looked into the net.minecraftforge.client.event.FOVUpdateEvent but it does not seem to be a cancelable event. Is overriding it an option I should consider?

Many many thanks to the Forge team for their work over the years!
Thank you for taking the time to read this.

Link to comment
Share on other sites

5 hours ago, AnaRchX said:

I looked into the net.minecraftforge.client.event.FOVUpdateEvent but it does not seem to be a cancelable event. Is overriding it an option I should consider?

You can useFOVUpdateEvent.setNewfov() to set it to the old value to avoid the FOV change.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.