Skip to content
laz edited this page Nov 22, 2026 · 8 revisions

Player

AddEffect(Effect, int(optional), bool(optional)))

Apply effect to player. First variable is Effect All possible effect values can be found here Effects.cs, second variable is optional effect duration in ticks variable. Default value is -1 that will apply for infinite time, last variable is bool that to show or hide effect particles. true to show particles, false to hide. Default value is true This example will apply Fire Resistance effect for 200 ticks or 10 seconds. Player can have multiple different effects at the same time.

player.AddEffect(Effects.FireResistance, 200)

ChangeDimension(Dimension, Vector3(optional))

Transfer player to another dimension of the World.

player.ChangeDimension(Dimension.Nether, new Vector3(0, 10, 0))

ChangeWorld(World, Vector3(optional))

Transfer player to another World.

player.ChangeWorld("SkyWars", new Vector3(0, 40, 0)) //"SkyWars" is world name for world found in worlds folder "SkyWars.mcworld"

Tip: If you need to switch from one world to another dimension of another world you can do simply use - GetDimension(Dimension) like this: Player.ChangeWorld(world.GetDimension(Dimension.Nether)); where world is target world.

ClearTitle()

Clear all on-screen titles and popups.

player.ClearTitle()

HideBossBar()

Destroy and hide bossbar that was created using ShowBossBar(string, float, float (optional)).

player.HideBossBar()

In case if you just want to update bossbar values you don't need to use ShowBossBar(). Instead you can use these methods:

SetBossBarColor(BossBarColor) - to update bossbar color

SetBossBarTitle(string) - to update bossbar title

SetBossBarValue(float) - to update bossbar value

Kick(String)

Disconnect player from the server with message.

player.Kick("You have been kicked");

MoveTo(Vector3)

Move player to specified location. (For longer distances use Teleport(Vector3))

player.MoveTo(new Vector3(10, -20, 15))

PlayAnimation(string, bool(optional))

Broadcast (Bool - true) or send to only player itself (Bool - false) animation registered by ResourcePackManager RegisterAnimation.

player.PlayAnimation("CustomSpawnAnimation")

ResendChunks()

todo

ResendChunk(int, int)

todo

RemoveEffect(Effect)

Remove effect from player that have been added using AddEffect(Effect, int(optional), bool(optional))) and it's duration is not ended.

Send(Packet)

Send custom data packet.

SetActorData setActorData = new SetActorData
{
   EntityId = 22,
   Metadata = new Dictionary<ActorData, Metadata>() { { ActorData.VISIBLE_MOB_EFFECTS, new Metadata(1) } }
};
player.Send(setActorData);

SendAbilities(byte, byte)

Change player permission levels.

player.SendAbilities(3, 0) //playerPermissions, commandPermissions

SendChatMessage(string, string)

Send chat message from specific source.

player.SendChatMessage("hi hi text message", "Bot1")

chatmessage

SendActionBarTitle(String, int(optional), int(optional), int(optional))

Send action bar messsage.

player.SendActionBarTitle("hi hi text message");

actionbar

SendJukeboxPopup(String)

Send jukebox like message popup.

player.SendJukeboxPopup("hi hi text message");

jukeboxpopup

SendLevelEvent(Vector3, LevelEvents, int(optional))

Send LevelEvent to specified player.

player.SendLevelEvent(new Vector3(10, -50, 20), LevelEvents.ParticlesEvaporate);

SendMetadata(Bool)

Send to player itself (Bool - false) or broadcast (Bool - true) to every player this player updated metadata values.

player.SendMetadata(true);

SendMessage(String)

Send chat message to specified player.

player.SendMessage("hi hi text message");

message

SendPopup(String)

Send tooltip like message popup.

player.SendPopup("hi hi text message");

popup

SendTip(String)

Send tooltip message.

player.SendTip("hi hi text message");

tip

SendTitle(String, String(optional), int(optional), int(optional), int(optional))

Send title and subtitle messages.

player.SendTitle("hi hi text message", "more text");

title

SetBossBarColor(BossBarColor)

Set color of the bossbar. Color values can be found in BossBarColor class.

player.SetBossBarColor(BossBarColor.Yellow);

Possible BossBarColor values are: Pink, Blue, Red, Green, Yellow, Purple, RebeccaPurple, White

bossbarcolor

SetBossBarTitle(string)

Set title of the bossbar.

player.SetBossBarTitle("Current streak");

SetBossBarValue(float)

Set value of the bossbar how full it should be. Minimum value is 0.0f and max value is 1.0f.

player.SetBossBarValue(0.4f);

SetFlag(ActorFlags, Bool)

Enable (Bool - true) or disable (Bool - false) ActorFlags data for the player.

player.SetFlag(ActorFlags.ONFIRE, true);

SetNameTag(string)

Change player display name that other players can see.

player.SetNameTag($"Mod {player.username}")

SetPermissions(PermissionSet)

Set custom player permissions using PermissionSet values.

player.SetPermissions(new PermissionSet() { Build = true, Mine = false, AttackMobs = true });

ShowBossBar(string, float, float (optional))

Initialize and show bossbar to the player. From code below value 10 is telling in how many blocks bossbar should be split. Value 0.3f is percentage value of the bossbar how full it should be. It's minimum value is always 0.0f and max value is 1.0f.

player.ShowBossBar("Current streak", 10, 0.3f);

bossbar

In case if you just want to update bossbar values you don't need to use HideBossBar(). Instead you can use these methods:

SetBossBarColor(BossBarColor) - to update bossbar color

SetBossBarTitle(string) - to update bossbar title

SetBossBarValue(float) - to update bossbar value

Teleport(Vector3)

Teleport player to specified location.

player.Teleport(new Vector3(10, -20, 15));

Transfer(String, ushort)

Transfter player to other server.

player.Transfer("mc.cobwebsmp.com", 19132);

Clone this wiki locally