Jump to content

Recommended Posts

Posted

I'm trying to figure out how to use setPose/setForcedPose properly, right now I'm facing some confusing behavior with it.

I've been playing with it in a simple onPlayerTick event, where I'm calling setPose for the event player. Here's what's happening:

#1:

@SubscribeEvent
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
	event.player.setForcedPose(Pose.FALL_FLYING);
}

Causes player to be in the pose properly.

 

#2:

@SubscribeEvent
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
	event.player.setPose(Pose.FALL_FLYING);
}

Causes player to be in the pose properly.

 

#3:

@SubscribeEvent
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
	if(event.side == LogicalSide.SERVER) {
		event.player.setForcedPose(Pose.FALL_FLYING);
	}
}

Doesn't change player from STANDING pose.

#4:

@SubscribeEvent
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
	if(event.side == LogicalSide.SERVER) {
		event.player.setPose(Pose.FALL_FLYING);
	}
}

Causes player to glitch rapidly between FALL_FLYING and STANDING

 

#4 doesn't make sense to me; Player also runs an update on Pose internally, which could cause the rapid switching, but #2 doesn't have the rapid switching. ForcedPose is supposed to suppress the internal updating, and keep the player in the ForcedPose, but it shows the forcedpose being ignored in #3.

I thought pose might not be being sent to the client side from the server side, but data for pose is stored in a SynchedEntityData.

I can't figure out why this is happening

 

I'm trying to use setPose from a capability, which is handled on the server side, which is where I first encountered this.

 

Posted

Players are usually controlled by the client.

https://forums.minecraftforge.net/topic/123317-1193-show-player-crawling-for-all-players/?do=findComment&comment=536039

You also need to check the "phase" of that tick event, otherwise you will do things twice per tick.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

  • 3 months later...

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.