✅ [API] PlayerNPC ✅ 1.17+ 2021.2

Player NPC via packets API for 1.17+

  1. SergiFerry
    Native Minecraft Version:
    1.17
    Tested Minecraft Versions:
    • 1.17
    Source Code:
    https://github.com/SergiFerry/PlayerNPC
    Contributors:
    https://twitter.com/SergiFerry
    playernpc.png
    asasd.png

    PlayerNPC is a simple NPC API for Spigot 1.17+, that allows you to create your own NPC per player.
    This plugin was developed by SergiFerry

    randomtpapi.png

    All JavaDocs are available at:
    https://sergiferry.github.io/PlayerNPC/

    Put the PlayerNPC.jar on your server's /plugins and add the jar to the llibary of your Java Project.

    Step 1, generate the NPC instance
    Code (Java):
    NPC npc = NPCLib.getInstance().generateNPC(player, id, location);
    Step 2, modify the NPC attributes
    Code (Java):
    npc.setSkin(new NPCSkin(texture, signature)); //Use https://mineskin.org/
    npc.setItem(NPCSlot, itemStack);
    npc.setText(String...);
    npc.setGlowing(boolean, color);
    npc.setCollidable(boolean);
    npc.setFollowingLookType(FollowingLookType);
    npc.setCustomTabListName(String, boolean);
    Step 3, create the entity and show it to the player
    Code (Java):
    npc.create();
    npc.show();
    You can listen for player interact with the NPC
    Code (Java):
    @EventHandler
    public void onNPCInteract(NPCInteractEvent event){
        Player player = event.getPlayer();
        NPC npc = event.getNpc();
        NPCInteractEvent.ClickType clickType = event.getClickType();
    }
    You can hide it temporally or destroy it permanent.
    Code (Java):
    npc.hide();
    npc.destroy();
    You can change the NPC skin, even when if it's created and shown.
    Code (Java):
    npc.setSkin(NPCSkin);
    npc.forceUpdate();
    You can change where the NPC looks at
    Code (Java):
    npc.lookAt(location);
    npc.update();
    You can change the NPC location
    Code (Java):
    npc.teleport(location);
    You can change the Text above the NPC
    Code (Java):
    npc.setText(String...);
    npc.updateText(); //if the text have the same amount of lines
    npc.forceUpdateText(); //if the text have different amount of lines
    npc.setHideText(boolean); //you can also hide the text and then show it later
    Remember that some changes at the NPC instance will not have effect on the player client until you update the npc.
    Code (Java):
    npc.update();
    npc.forceUpdate();
    randomtpcommands.png

    /npc - Let you customize the npcs.
    This command is only available for OPs.
    npcsccommands.gif
    randomtpstats.png
    [​IMG]
    Faun likes this.

Recent Reviews

  1. maximeCX
    maximeCX
    5/5,
    Version: 1.0.8
    solid plugin. Easy to use, very customizable and it saved me tons of time making my own. Thank you dev
  2. hugogaymer
    hugogaymer
    5/5,
    Version: 1.0.1
    nice .