Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
hapily04 committed Jun 29, 2024
2 parents dd2bcb0 + 42612b4 commit 4dff9dd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ Simple nametag library for Minestom using text displays, handling the tracking a
```java
MiniMessage miniMessage = MiniMessage.miniMessage();
GlobalEventHandler eventHandler = MinecraftServer.getGlobalEventHandler();
NameTagManager nameTagManager = new NameTagManager(eventHandler);
TeamManager teamManager = MinecraftServer.getTeamManager();
Team nameTagTeam = new TeamBuilder("name-tags", teamManager)
.nameTagVisibility(TeamsPacket.NameTagVisibility.NEVER)
.collisionRule(TeamsPacket.CollisionRule.NEVER)
.build();
NameTagManager nameTagManager = new NameTagManager(eventHandler, entity -> nameTagTeam);
globalEventHandler.addListener(PlayerSpawnEvent.class, event -> {
Player player = event.getPlayer();
NameTag playerNameTag = nameTagManager.createNameTag(player);
Expand All @@ -28,7 +33,7 @@ repositories {
```gradle
dependencies {
..
implementation("com.github.echolightmc:MSNameTags:1.1-SNAPSHOT") {
implementation("com.github.echolightmc:MSNameTags:1.2-SNAPSHOT") {
exclude group: "net.minestom", module: "minestom-snapshots"
}
}
Expand Down

0 comments on commit 4dff9dd

Please sign in to comment.