Solved Vault NPE

Discussion in 'Spigot Plugin Development' started by CrafterChris, May 24, 2019.

  1. I feel really silly asking about this but I couldn't find a fix.
    I'm trying to use Vault's chat prefix and suffix stuff, so I hooked into it.
    Code (Text):

    private Chat chat;

    private boolean setupChat() {
       RegisteredServiceProvider<Chat> rsp = getServer().getServicesManager().getRegistration(;
       chat = rsp.getProvider();
       return chat != null;

    public Chat getChat() {
       return chat;
    This is my onEnable.
    Code (Text):

    public void onEnable() {
       so("&cCORE&7: &fCore Plugin Version &c" + version + " &fEnabling!");

       so("&cCORE&7: &fVault hooked!");
    It NPE's on rsp.getProvider
    Code (Text):

    24.05 00:28:27 [Server] ERROR Error occurred while enabling Core v0.0.1 (Is it up to date?) 24.05 00:28:27
    [Server] INFO java.lang.NullPointerException: null 24.05 00:28:27
    [Server] INFO at ~[?:?] 24.05 00:28:27
    [Server] INFO at ~[?:?] 24.05 00:28:27
    [Server] INFO at ~[patched_1.14.1.jar:git-Paper-23] 24.05 00:28:27
    [Server] INFO at ~[patched_1.14.1.jar:git-Paper-23] 24.05 00:28:27
    [Server] INFO at org.bukkit.plugin.SimplePluginManager.enablePlugin( ~[patched_1.14.1.jar:git-Paper-23] 24.05 00:28:27
    [Server] INFO at org.bukkit.craftbukkit.v1_14_R1.CraftServer.enablePlugin( ~[patched_1.14.1.jar:git-Paper-23] 24.05 00:28:27
    [Server] INFO at org.bukkit.craftbukkit.v1_14_R1.CraftServer.enablePlugins( ~[patched_1.14.1.jar:git-Paper-23] 24.05 00:28:27
    [Server] INFO at net.minecraft.server.v1_14_R1.MinecraftServer.a( ~[patched_1.14.1.jar:git-Paper-23] 24.05 00:28:27
    [Server] INFO at net.minecraft.server.v1_14_R1.DedicatedServer.init( ~[patched_1.14.1.jar:git-Paper-23] 24.05 00:28:27
    [Server] INFO at ~[patched_1.14.1.jar:git-Paper-23] 24.05 00:28:27
    [Server] INFO at [?:1.8.0_141]
    Here's the plugin yml
    Code (Text):

    depend: [WorldEdit, ViaVersion, Vault]
    Vault is confirmed to load before it. So, no idea what's wrong...
  2. You need a chat plugin on your server
  3. Is there a tutorial for creating a chat plugin through Vault, I'm not finding one.
  4. Um no? You literally need to download a chat plugin for Vault to hook into. Get EssentialsXChat or something
  5. So there's no resources whatsoever on creating my own EssentialsXChat?
  6. ..... You need a chat plugin which Vault supports. @xTrollxDudex gave you a suggestion. Are you ..................
  7. I'm just wondering at this point if there's any resources available to guide the development of my own chat plugin? Rather than installing a pre-existing one, I'd like to implement one on my own for the learning experience. From what I've gathered it isn't something you can just go about doing, so in the worst case, sure I'll install a chat formatter.
  8. Apologies, your intentions weren't clear from the outset. Are you trying to create a chat plugin? You're the one implementing the Chat instance then. See Getting a registered Chat provider is for plugins that want to hook into it.
    • Agree Agree x 1
  9. Sorry for being unclear, thanks for the tip, marking as solved.

Share This Page