From 35bad45d747c3f881cf0be4b68b5c04f92fc315b Mon Sep 17 00:00:00 2001 From: JitseB Date: Fri, 13 Apr 2018 18:58:24 +0200 Subject: [PATCH] Added usage section to README. --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 2cd41f1..85528c9 100644 --- a/README.md +++ b/README.md @@ -7,4 +7,27 @@ This is an API made specifically for spigot servers (Minecraft). Current versions supported: 1.8 - 1.12. +## Usage + +```Java + // First we define our (global) library variable. + // This is usually done in the onEnable method. + NPCLib lib = new NPCLib(plugin); +``` + +```Java + // If you want to spawn an NPC, you can generate it like so: + NPC npc = lib.createNPC(skin, autoHideDistance, lines); + + // Then you need to generate the packets for the NPC like so: + npc.create(location); + + // Then, finally, you can show/hide it to/from players like so: + npc.show(player); + npc.hide(player); + + // If you don't use the NPC anymore, destroy it accordingly: + npc.destroy(); +``` + All rights reserved. \ No newline at end of file