From ad594bfc243ebb0b177fc25c084d2684062bfdc5 Mon Sep 17 00:00:00 2001 From: OliverSchlueter Date: Thu, 4 Jan 2024 13:03:15 +0100 Subject: [PATCH] Move over FancyNpcs docs --- Writerside/fp.tree | 6 +- Writerside/redirection-rules.xml | 4 + Writerside/topics/FH-API.md | 37 ++++- Writerside/topics/FN-API.md | 103 ++++++++++++- Writerside/topics/FN-Commands.md | 194 ++++++++++++++++++++++++- Writerside/topics/FN-Misc.md | 3 + Writerside/topics/FN-Multiple-lines.md | 12 ++ Writerside/topics/FancyNpcs.md | 36 ++++- 8 files changed, 390 insertions(+), 5 deletions(-) create mode 100644 Writerside/topics/FN-Misc.md create mode 100644 Writerside/topics/FN-Multiple-lines.md diff --git a/Writerside/fp.tree b/Writerside/fp.tree index 2932673..9a23c6f 100644 --- a/Writerside/fp.tree +++ b/Writerside/fp.tree @@ -11,11 +11,15 @@ + + + - + + diff --git a/Writerside/redirection-rules.xml b/Writerside/redirection-rules.xml index d6c60c6..9e454ac 100644 --- a/Writerside/redirection-rules.xml +++ b/Writerside/redirection-rules.xml @@ -30,4 +30,8 @@ Created after removal of "This is the first topic" from FancyPlugins Default-topic.html + + Created after removal of "Getting started" from FancyPlugins + FN-API-Getting-started.html + \ No newline at end of file diff --git a/Writerside/topics/FH-API.md b/Writerside/topics/FH-API.md index 555e05f..33afe35 100644 --- a/Writerside/topics/FH-API.md +++ b/Writerside/topics/FH-API.md @@ -1,3 +1,38 @@ # API -TODO \ No newline at end of file +## Including the API into your project + +### Gradle + +```gradle +repositories { + maven("https://repo.fancyplugins.de/releases") + ... +} +``` + +```gradle +dependencies { + compileOnly("de.oliver:FancyHolograms:version") + ... +} +``` + +### Maven + +```maven + + fancyplugins-releases + FancyPlugins Repository + https://repo.fancyplugins.de/releases + +``` + +```maven + + de.oliver + FancyHolograms + VERSION + + +``` \ No newline at end of file diff --git a/Writerside/topics/FN-API.md b/Writerside/topics/FN-API.md index 555e05f..c8f37a8 100644 --- a/Writerside/topics/FN-API.md +++ b/Writerside/topics/FN-API.md @@ -1,3 +1,104 @@ # API -TODO \ No newline at end of file +## Including the API into your project + +### Gradle + +```gradle +repositories { + maven("https://repo.fancyplugins.de/releases") + ... +} +``` + +```gradle +dependencies { + compileOnly("de.oliver:FancyNpcs:version") + ... +} +``` + +### Maven + +```maven + + fancyplugins-releases + FancyPlugins Repository + https://repo.fancyplugins.de/releases + +``` + +```maven + + de.oliver + FancyNpcs + VERSION + + +``` + +## List of all events + +### NpcCreateEvent + +Is fired when a new NPC is being created + +### NpcRemoveEvent + +Is fired when a NPC is being removed + +### NpcSpawnEvent + +Is fired when a NPC is being spawned + +### NpcModifyEvent + +Is fired when a NPC is being modified + +### NpcInteractEvent + +Is fired when a player interacts with a NPC + +### NpcStartLookingEvent + +Is fired when NPC starts looking at a player + +### NpcStopLookingEvent + +Is fired when NPC stops looking at a player + +## Creating a NPC + +```java +NpcData data = new NpcData("myNpc", creatorUUID, location); +SkinFetcher skin = new SkinFetcher("username or url"); +data.setSkin(skin); +data.setDisplayName("cool displayname"); + +Npc npc = FancyNpcsPlugin.get().getNpcAdapter().apply(data); +FancyNpcsPlugin.get().getNpcManager().registerNpc(npc); +npc.create(); +npc.spawnForAll(); +``` + +## Modify a NPC + +```java +Npc npc = FancyNpcsPlugin.get().getNpcManager().getNpc("myNpc"); +npc.getData().setDisplayName("New cool display name"); + +npc.updateForAll(); + +// for some modifications you need to respawn the npc +npc.removeForAll(); +npc.spawnForAll(); +``` + +## Remove a NPC + +```java +Npc npc = FancyNpcsPlugin.get().getNpcManager().getNpc("myNpc"); +npc.removeForAll(); + +FancyNpcsPlugin.get().getNpcManager().removeNpc(npc); +``` \ No newline at end of file diff --git a/Writerside/topics/FN-Commands.md b/Writerside/topics/FN-Commands.md index e89dfa4..84396bc 100644 --- a/Writerside/topics/FN-Commands.md +++ b/Writerside/topics/FN-Commands.md @@ -1,3 +1,195 @@ # Commands -TODO \ No newline at end of file +This page provides detailed information about the various commands available in FancyNpcs, allowing you to make the +most out of its features. + +## /FancNpcs ... + +This command is to manage the plugin itself. + +### version + +Description: Shows the current version of the plugin
+Syntax: ``/FancyNpcs version``
+Permission: ``FancyNpcs.admin`` + +### reload + +Description: Reloads the language file and all npcs
+Syntax: ``/FancyNpcs reload``
+Permission: ``FancyNpcs.admin`` + +### save + +Description: Saves all npcs to disk
+Syntax: ``/FancyNpcs save``
+Permission: ``FancyNpcs.admin`` + +### featureFlags + +Description: Shows a list of all enabled feature flags
+Syntax: ``/FancyNpcs featureFlags``
+Permission: ``FancyNpcs.admin`` + +## /Npc ... + +This command is to manage the npcs. + +For all subcommands of /npc - ``FancyNpcs.npc.*``
+ +### help + +Description: Shows a list of all commands
+Syntax: ``/Npc help``
+Permission: ``FancyNpcs.npc.help`` or ``FancyNpcs.npc.*`` + +### info + +Description: Shows all important information about an npc
+Syntax: ``/Npc into (npc)``
+Permission: ``FancyNpcs.npc.info`` or ``FancyNpcs.npc.*`` + +### create + +Description: Creates a new npc at your location
+Syntax: ``/Npc create (npc)``
+Permission: ``FancyNpcs.npc.create`` or ``FancyNpcs.npc.*`` + +### remove + +Description: Removes the npc
+Syntax: ``/Npc remove (npc)``
+Permission: ``FancyNpcs.npc.remove`` or ``FancyNpcs.npc.*`` + +### copy + +Description: Creates a copy of the npc
+Syntax: ``/Npc copy (npc) (new name)``
+Permission: ``FancyNpcs.npc.copy`` or ``FancyNpcs.npc.*`` + +### list + +Description: Shows a list of all created npcs
+Syntax: ``/Npc list``
+Permission: ``FancyNpcs.npc.list`` or ``FancyNpcs.npc.*`` + +### type + +Description: Changes the entity type of the npc
+Syntax: ``/Npc type (npc name) (type)``
+Permission: ``FancyNpcs.npc.type`` or ``FancyNpcs.npc.*`` + +When using any entity type other than Player, the following features are disabled: + +- Changing the skin +- Changing the equipment +- Showing in tab + +### attribute + +Description: Changes a type-specific attribute of the npc
+Syntax: ``/Npc attribute (npc name) (attribute) (value)``
+Permission: ``FancyNpcs.npc.attribute`` or ``FancyNpcs.npc.*`` + +### displayName + +Description: Changes the displayname of the npc
+Syntax: ``/Npc displayName (npc name) (display name ...)``
+Permission: ``FancyNpcs.npc.displayName`` or ``FancyNpcs.npc.*``
+Placeholders: + +- all placeholders from PlaceholderAPI +- ```` will make the displayname disappear completely + +### showInTab + +Description: Changes whether the npc will be shown in the tablist or not
+Syntax: ``/Npc showInTab (npc name) ('true' | 'false')``
+Permission: ``FancyNpcs.npc.showInTab`` or ``FancyNpcs.npc.*`` + +### skin + +Description: Changes the skin of the npc
+Syntax: ``/Npc skin (npc name) (username | url to .png)``
+Syntax: ``/Npc skin`` - uses your skin
+Permission: ``FancyNpcs.npc.skin`` or ``FancyNpcs.npc.*`` + +### equipment + +Description: Equips the npc with item you are holding in your mainhand
+Syntax: ``/Npc equipment (npc name) (slot)``
+Permission: ``FancyNpcs.npc.equipment`` or ``FancyNpcs.npc.*`` + +### glowing + +Description: Changes whether the npc should glow or not
+Syntax: ``/Npc glowing (npc name) ('true' | 'false')``
+Permission: ``FancyNpcs.npc.glowing`` or ``FancyNpcs.npc.*`` + +### glowingColor + +Description: Changes the color of the glowing effect
+Syntax: ``/Npc glowingColor (npc name) (color)``
+Permission: ``FancyNpcs.npc.glowingColor`` or ``FancyNpcs.npc.*`` + +### collidable + +Description: Changes whether the NPC will be collidable or not
+Syntax: ``/Npc collidable (npc name) ('true' | 'false')``
+Permission: ``FancyNpcs.npc.collidable`` or ``FancyNpcs.npc.*`` + +### turnToPlayer + +Description: Changes whether the npc will turn to near players or not
+Syntax: ``/Npc turnToPlayer (npc name) ('true' | 'false')``
+Permission: ``FancyNpcs.npc.turnToPlayer`` or ``FancyNpcs.npc.*`` + +### message + +Description: Changes the messages that will be sent to the player when interacting with the npc
+Syntax: ``/Npc message (npc name) add (message)`` - adds a new message
+Syntax: ``/Npc message (npc name) set (index) (message)`` - sets a message at an index
+Syntax: ``/Npc message (npc name) remove (index)`` - removes a message at an index
+Syntax: ``/Npc message (npc name) clear`` - removes all messages
+Permission: ``FancyNpcs.npc.message`` or ``FancyNpcs.npc.*``
+Placeholders: + +- all placeholders from PlaceholderAPI + +### playerCommand + +Description: Changes the command that the player executes when interacting with the npc
+Syntax: ``/Npc playerCommand (npc name) ('none' | message ...)``
+Permission: ``FancyNpcs.npc.playerCommand`` or ``FancyNpcs.npc.*``
+Placeholders: + +- all placeholders from PlaceholderAPI + +### serverCommand + +Description: Changes the command that the console executes when interacting with the npc
+Syntax: ``/Npc serverCommand (npc name) ('none' | message ...)``
+Permission: ``FancyNpcs.npc.serverCommand`` or ``FancyNpcs.npc.*``
+Placeholders: + +- all placeholders from PlaceholderAPI +- ``{player}`` - the player's username + +### interactionCooldown + +Description: Changes the cooldown for player interactions with the npc
+Syntax: ``/Npc interactionCooldown (npc name) (time in seconds)``
+Permission: ``FancyNpcs.npc.interactionCooldown`` or ``FancyNpcs.npc.*``
+ +### moveHere + +Description: Teleports the npc to you
+Syntax: ``/Npc moveHere (npc name)``
+Permission: ``FancyNpcs.npc.moveHere`` or ``FancyNpcs.npc.*`` + +### teleport + +Description: Teleports the npc to the provided location
+Syntax: ``/Npc teleport (npc name) (x) (y) (z) [world]``
+_The ``world`` parameter is optional._
+Permission: ``FancyNpcs.npc.teleport`` or ``FancyNpcs.npc.*`` diff --git a/Writerside/topics/FN-Misc.md b/Writerside/topics/FN-Misc.md new file mode 100644 index 0000000..871f942 --- /dev/null +++ b/Writerside/topics/FN-Misc.md @@ -0,0 +1,3 @@ +# Misc + +Miscellaneous topics that don't fit anywhere else. \ No newline at end of file diff --git a/Writerside/topics/FN-Multiple-lines.md b/Writerside/topics/FN-Multiple-lines.md new file mode 100644 index 0000000..d65f73d --- /dev/null +++ b/Writerside/topics/FN-Multiple-lines.md @@ -0,0 +1,12 @@ +# Multiple lines + +To have multiple lines as the display name of an NPC follow the following steps: + +1. download the [FancyHolograms](https://modrinth.com/plugin/fancyholograms/versions) plugin and put it in the plugins + folder +2. start your server and make sure the FancyNpcs and FancyHolograms plugin have both loaded +3. create a hologram with multiple lines +4. create a npc +5. link the hologram with the npc `/hologram edit linkWithNpc ` +6. you can now move the npc around and the hologram will always follow +7. to unlink simply run `/hologram edit unlinkWithNpc` \ No newline at end of file diff --git a/Writerside/topics/FancyNpcs.md b/Writerside/topics/FancyNpcs.md index c3677df..aab82c8 100644 --- a/Writerside/topics/FancyNpcs.md +++ b/Writerside/topics/FancyNpcs.md @@ -1,3 +1,37 @@ # FancyNpcs -TODO \ No newline at end of file +![Latest Version](https://img.shields.io/github/v/release/FancyMcPlugins/FancyNpcs?style=flat-square) +[![SpigotMC Downloads](https://badges.spiget.org/resources/downloads/spigotmc-orange-107306.svg)](https://www.spigotmc.org/resources/npc-plugin-1-19-4.107306/) +[![Downloads](https://img.shields.io/modrinth/dt/fancynpcs?color=00AF5C&label=modrinth&style=flat&logo=modrinth)](https://modrinth.com/plugin/fancynpcs/versions) +![GitHub Downloads](https://img.shields.io/github/downloads/FancyMcPlugins/FancyNpcs/total?logo=GitHub&style=flat-square) + +FancyNpcs is a simple and lightweight npc plugin for minecraft servers. It is using packets and therefore it is +blazingly fast. + +The plugin is only supported for **1.19.4 - latest version** + +It is highly recommended to use Paper or a fork of it - Folia is also supported. + +[Getting started](FN-Getting-started.md)
+[Go to the commands](FN-Commands.md)
+[Go to the api](FH-API.md) + +# Features + +With FancyNpcs you can create NPCs that look like real players. You can edit a bunch of properties like the display name +or skin. + +All properties: + +- display name +- skin (username or url) +- entity type (cow, pig, blaze etc.) +- equipment (e.g. holding something in the hand) +- glowing (in all colors) +- and many more properties that are entity specific + +You can also define some actions that will be executed when a player interacts with the npc: + +- message: sends a simple message to the player +- player command: forces the player to execute a command +- server command: executes a command in the console \ No newline at end of file