View on GitHub

MultiLineAPI

A Minecraft API that allows you to add multiple lines for a player's name

Description

MultiLineAPI is an easy to use API that allows the server to display infinite lines of text under the nametag for each player, and allows an entity’s nametag to be changed (without the limitations of other methods - see below for more information).

MultiLineAPI vs Scoreboards and other alternatives

  MultiLineAPI Vanilla Scoreboard TagAPI NickNamer
Nametag support
Character limit (name / line) (∞ / ∞) (✘ / 16) (16 / ✘) (16 / ✘)
Included API
Minecraft version 1.8+ 1.6+ 1.7 and below. 1.7 - 1.12
Per-player lines and nametag ✔ (name only) ✔ (name only)
Commands
Software Requirements Plugin, PacketEntityAPI, & ProtocolLib Plugin Plugin & PacketListenerAPI

Compatibility and Dependencies

MultiLineAPI currently requires PacketEntityAPI, which requires ProtocolLib. PacketEntityAPI is used to provide viewer-dependant lines and the more efficient fake entities used by this library. This provides an advantage in stability because even if there is an issue where tags become separated from their targets, they will be reset upon re-login without any changes to the actual world. Furthermore, the mount-based renderer uses a few entities that, because of PacketEntityAPI, do not have to be ticked server-side.

There are no known incompatibilities; however, no guarantees that this plugin will work with packet-modifying plugins such as ViaVersion or ProtocolSupport.

Commands & Permissions

MultiLineAPI currently does not have any commands or permissions.

Configuration

MultiLineAPI has a very light configuration, which is used to let you select the proper renderers and configure the line spacings. Here it is:

#MUST be 'MOUNT' or 'TELEPORT'
defaultRenderer: "MOUNT"

#Here are the options for each renderer
options:
    lineHeight: 0.28
    bottomLineHeight: 0.12
    teleport:
        animated: true

#Here you can define overrides for specific entity types to use one or the other. The key must be the name of the entity
#type, found here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html
typeRenderers:
    ARROW: "TELEPORT"
    DRAGON_FIREBALL: "TELEPORT"
    ENDER_PEARL: "TELEPORT"
    ENDER_SIGNAL: "TELEPORT"
    UNKNOWN: "MOUNT"

There are a few differences between the two renderers (the mount-based renderer or the teleport-based renderer). Here is a comparison table:

Mount-Based Renderer
Teleport-Based Renderer
Pros
Cons
Pros
Cons
  • Tag follows entity movements exactly - including client-side assumptions
  • Smooth animations when lines are added and removed
  • Far fewer packets dispatched
  • More stable
  • Uses at least 2 entities to customize the display name, with an additional 6 for each line
  • Large amounts of lines can quickly become laggy for clients
  • Collision boxes of spacing entities cause tags to become bouncy (this may be fixed in the future)
  • Projectiles will collide with their passengers during flight; however, the path of the projectile is not altered because the collision is client-side
  • Fewer entities are used - just 2 entities for the name customization and 1 entity for each line
  • Large amounts of lines are more manageable
  • Projectiles cannot collide with the lines
  • Spacing between lines can be customized
  • Sends far more packets - any move packet for an entity with a customized tag has to be cloned for its nametag and each additional line
  • Tags can sometimes lag behind the movement of the entities - especially on things where the client makes assumptions (entities being pushed by pistons, projectiles)
  • Known Limitations

    With the teleportation-based renderer, sometimes the entities may become separated from their targets. If this happens, please re-log and create an issue with steps to reproduce it so MLAPI can be improved.

    API Usage

    MultiLineAPI is designed as an API. It is not meant to be used as a plugin on its own. As such, it will not do anything unless another plugin has been installed that depends upon it. API documentation is available here.

    Frequently Asked Questions:

    Q: Does MultiLineAPI support entities?

    Yes!

    Q: Is there a limit on how many lines a tag can have?

    Nope. However, I would suggest that you keep it to a maximum of four as a rule of thumb.

    But here’s a GIF from testing:

    AmericanFlag

    Q: How is the order of added lines determined?

    Registered tag controllers provide a priority for their name changes and their added lines. Higher priority lines are shown above lower priority lines.

    Note to developers: You should allow users to configure the priority.

    Images

    Coming soon!

    Issues

    You may report issues here. Please include the following information, otherwise your report will be ignored:

    Source Code

    Source code is available here!

    Donations

    Want to donate to continue MultiLineAPI’s development? I accept donations here: