Skip to content

Commit 98b7400

Browse files
committed
feat(scoreboard): finish
1 parent b6057ce commit 98b7400

4 files changed

Lines changed: 178 additions & 1 deletion

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"title": "Scoreboard",
33
"defaultOpen": false,
4-
"pages": ["sidebar"]
4+
"pages": ["sidebar", "team"]
55
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Creating Team
3+
---
4+
5+
Lynx allows you to create fully packet based teams. This is useful for server performance because we can run and send the packet async.
6+
7+
Let's start by creating a team. We can do this by creating a new instance of `Team`. When creating this you will see some options you can choose from.
8+
9+
Let's look at the first one. Its called `autoLoad` when this is on `true` it will automatically send the team packet to all the player to register the team. It won't add them to the team, but it will allow them to see it. If its `false` it won't do this automatically, and you will have to use the `.addViewer(player)` method. By default, this is set to `true`.
10+
11+
Next we have `aync` if this is on `true` it will send the packet asynchronous, by default this is set to `false`.
12+
13+
Lastly you can choose the `order` index. This will determine where the team will show up in team. This is a `Int` between 1 and 999.
14+
15+
Let's create a team now:
16+
17+
```java tab="Java"
18+
new Team();
19+
```
20+
```kotlin tab="Kotlin"
21+
team()
22+
```
23+
24+
# Entry
25+
26+
You are able to add an player to the team by using `.addEntry(player)`:
27+
28+
<Callout title="Important" type="info">
29+
Adding entry will be using the players username. Sadly this is a limitation of minecraft.
30+
</Callout>
31+
32+
```java tab="Java"
33+
new Team()
34+
.addEntry(player);
35+
```
36+
```kotlin tab="Kotlin"
37+
team()
38+
.addEntry(player)
39+
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"title": "Teams",
3+
"defaultOpen": false,
4+
"pages": ["creating-team", "modifing-team"]
5+
}
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
title: Modifying Team
3+
---
4+
5+
Teams have a lot of possible modifications you can change on it. Let's start with cosmetics.
6+
7+
# Cosmetics
8+
9+
## Prefix
10+
Teams all you to change the prefix in front of the players name. You can both use `String` and `Component`:
11+
12+
<Tabs items={["Java", "Kotlin"]}>
13+
<Tab value="Java">
14+
```java tab="String"
15+
new Team()
16+
.setPrefix("Cool Prefix ");
17+
```
18+
```java tab="Component"
19+
new Team()
20+
.setPrefixComponent(Component.text("Cool Prefix "));
21+
```
22+
</Tab>
23+
<Tab value="Kotlin">
24+
```java tab="String"
25+
team {
26+
setPrefix("Cool Prefix ")
27+
}
28+
```
29+
```java tab="Component"
30+
team {
31+
setPrefixComponent(Component.text("Cool Prefix "))
32+
}
33+
```
34+
</Tab>
35+
</Tabs>
36+
37+
## Suffix
38+
The same as prefix you can set the suffix with both a `String` and `Component`:
39+
40+
<Tabs items={["Java", "Kotlin"]}>
41+
<Tab value="Java">
42+
```java tab="String"
43+
new Team()
44+
.setSuffix("Cool Prefix ");
45+
```
46+
```java tab="Component"
47+
new Team()
48+
.setSuffixComponent(Component.text("Cool Prefix "));
49+
```
50+
</Tab>
51+
<Tab value="Kotlin">
52+
```java tab="String"
53+
team {
54+
setSuffix("Cool Prefix ")
55+
}
56+
```
57+
```java tab="Component"
58+
team {
59+
setSuffixComponent(Component.text("Cool Prefix "))
60+
}
61+
```
62+
</Tab>
63+
</Tabs>
64+
65+
## Color
66+
67+
Lastly with cosmetics you are able to modify the teams color. This will change the color of the players name as well:
68+
69+
```java tab="Java"
70+
new Team()
71+
.setColor(ChatColor.RED);
72+
```
73+
```kotlin tab="Kotlin"
74+
team {
75+
setColor(ChatColor.RED)
76+
}
77+
```
78+
79+
# Friendly Invisible
80+
81+
When this option is `true` you can see player that are invisible in the same team, by default it is `true`:
82+
83+
```java tab="Java"
84+
new Team()
85+
.setSeeFriendlyInvisible(true);
86+
```
87+
```kotlin tab="Kotlin"
88+
team {
89+
setSeeFriendlyInvisible(true)
90+
}
91+
```
92+
93+
# Name Tag Visibility
94+
95+
This option will allow you to the name tag visibility. You will set it with using `NameTagVisibility` enum. In this enum there are these options:
96+
97+
- ALWAYS
98+
- NEVER
99+
- HIDE_FOR_OTHER_TEAMS
100+
- HIDE_FOR_OWN_TEAM
101+
102+
By default, it is `ALWAYS`
103+
104+
```java tab="Java"
105+
new Team()
106+
.setNameTagVisibility(NameTagVisibility.NEVER);
107+
```
108+
```kotlin tab="Kotlin"
109+
team {
110+
setNameTagVisibility(NameTagVisibility.NEVER)
111+
}
112+
```
113+
114+
# Collision Rule
115+
116+
The last option will allow you how the players collision happens. These are the available options:
117+
118+
- ALWAYS
119+
- NEVER
120+
- FOR_OTHER_TEAMS
121+
- FOR_OWN_TEAM
122+
123+
By default, it is `ALWAYS`
124+
125+
```java tab="Java"
126+
new Team()
127+
.setCollisionRule(CollisionRule.NEVER);
128+
```
129+
```kotlin tab="Kotlin"
130+
team {
131+
setCollisionRule(CollisionRule.NEVER)
132+
}
133+
```

0 commit comments

Comments
 (0)