Sueta

[API] TruenoNPC | Creates easy NPCs [1.8-1.12]

1.3

Simple API to create NPCs with skin and without nametag

·Plugin

TruenoNPC
API for create NPCs without nametags in Spigot/Bukkit. It's compatible with 1.8 to 1.12 versions

Please if you are going to use this api, give me credits. Just a simple mention is welcome c:

Donate me
If you like my work, please, consider donating

Features:

  • 1.8-1.12 support.
  • NPCs with skin (and with second layer).
  • Automatic render/unrender system. Create the npc and will be visible for all the players incluided incoming players.
  • NPCs without nametag, so you can create an hologram obove without character restriction.
  • Incluided packetlistening and events:
    • Spawn Event
    • Despawn Event
    • Interact Event

Usage:

  1. Clone the repo and integrate it in your proyect.
  2. Remove nms classes that you don't be using from .nms package and TruenoNPCApi (If your plugin is not compatible 1.8 - 1.12).
  3. Create your npcs!

Plugins using it:

Servers using it:

  • (Official) mc.linvio.net
  • mc.comugamers.com
  • gravenmc.fr

Examples:

Code Examples
  • Create NPC:
    //First create the skin
    TruenoNPCSkin skin = TruenoNPCSkinBuilder.fromUsername(this.plugin, p.getName());
    TruenoNPCSkin skin = TruenoNPCSkinBuilder.fromUUID(this.plugin, p.getUniqueId().toString());
    TruenoNPCSkin skin = TruenoNPCSkinBuilder.fromMineskin(this.plugin, 131234);
    
    //Now create the NPC ussing the skin
    TruenoNPC npc = TruenoNPCApi.createNPC(main.getPlugin(), p.getLocation(), skin);
  • NPC methods:
    TruenoNPC npc = TruenoNPCApi.createNPC(main.getPlugin(), p.getLocation(), "el_trueno");
    npc.delete(); // Delete the npc
    npc.getLocation(); // Returns npc location
    npc.getEntityID(Player); // Return entity id (int)
    npc.isDeleted(); // Returns if the npc has been deleted;
  • NPC Events Listening:
    @EventHandler
        public void OnInteract(TruenoNPCInteractEvent ev){
            TruenoNPC npc = ev.getNPC();
            Player player = ev.getPlayer();
        }
    
        @EventHandler
        public void onSpawn(TruenoNPCSpawnEvent ev){
            TruenoNPC npc = ev.getNPC();
            Player player = ev.getPlayer();
        }
    
        @EventHandler
        public void onDespawn(TruenoNPCDespawnEvent ev){
            TruenoNPC npc = ev.getNPC();
            Player player = ev.getPlayer();
        }

Screenshots:

Screenshots

Thanks to:

Donate me
If you like my work, please, consider donating

Contact me

Bitbucket fallback repository: https://bitbucket.org/el_trueno/truenonpc

Similar projects

Plugin →