Skip to content

Instantly share code, notes, and snippets.

@Samueljh1
Last active July 19, 2018 19:40
Show Gist options
  • Save Samueljh1/b49763887afe41b59dc87740e4367f90 to your computer and use it in GitHub Desktop.
Save Samueljh1/b49763887afe41b59dc87740e4367f90 to your computer and use it in GitHub Desktop.
public override void SetNameTag(string nameTag)
{
NameTag = nameTag;
var remove = McpeRemoveEntity.CreateObject();
remove.entityIdSelf = EntityId;
Level.RelayBroadcast(remove);
var add = McpeAddPlayer.CreateObject();
add.uuid = ClientUuid;
add.username = nameTag;
add.entityIdSelf = EntityId;
add.runtimeEntityId = EntityId;
add.x = KnownPosition.X;
add.y = KnownPosition.Y;
add.z = KnownPosition.Z;
add.yaw = KnownPosition.Yaw;
add.headYaw = KnownPosition.HeadYaw;
add.pitch = KnownPosition.Pitch;
add.metadata = GetMetadata();
Level.RelayBroadcast(add);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment