Skip to content

Commit 0222fa3

Browse files
Add fancyworlds docs
1 parent 9817ed4 commit 0222fa3

16 files changed

Lines changed: 337 additions & 3 deletions

File tree

content/docs/minecraft-plugins/fancydialogs/api/getting-started.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repositories {
2020

2121
```kotlin
2222
dependencies {
23-
compileOnly("de.oliver:FancyDialogs:1.1.1")
23+
compileOnly("de.oliver:FancyDialogs:1.1.2")
2424
}
2525
```
2626

@@ -37,12 +37,12 @@ dependencies {
3737
<dependency>
3838
<groupId>de.oliver</groupId>
3939
<artifactId>FancyDialogs</artifactId>
40-
<version>1.1.1</version>
40+
<version>1.1.2</version>
4141
<scope>provided</scope>
4242
</dependency>
4343
```
4444

45-
Replace `1.1.1` with the version of the API you want to use. You can find the latest version on the download pages or in the GitHub releases.
45+
Replace `1.1.2` with the version of the API you want to use. You can find the latest version on the download pages or in the GitHub releases.
4646

4747
## Show a notice dialog
4848

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
title: Getting Started
3+
description: How to get started with the FancyWorlds API
4+
---
5+
6+
{/* The source of this file is in the "/templates/" directory. Changes in the file in "/content/docs/" will be overridden. */}
7+
8+
## Include the API in your project
9+
10+
To include the FancyNPCs API in your project, you need to add the following dependency to your `build.gradle.kts` or `pom.xml` file.
11+
12+
**Latest version**: <LatestVersion project="FancyNpcs" showDevBuilds />
13+
14+
**Gradle:**
15+
```kotlin
16+
repositories {
17+
maven("https://repo.fancyinnovations.com/releases")
18+
}
19+
```
20+
21+
```kotlin
22+
dependencies {
23+
compileOnly("de.oliver:FancyNpcs:2.9.2")
24+
}
25+
```
26+
27+
**Maven:**
28+
```xml
29+
<repository>
30+
<id>fancyinnovations-releases</id>
31+
<name>FancyInnovations Repository</name>
32+
<url>https://repo.fancyinnovations.com/releases</url>
33+
</repository>
34+
```
35+
36+
```xml
37+
<dependency>
38+
<groupId>de.oliver</groupId>
39+
<artifactId>FancyNpcs</artifactId>
40+
<version>2.9.2</version>
41+
<scope>provided</scope>
42+
</dependency>
43+
```
44+
45+
Replace `2.9.2` with the version of the API you want to use. You can find the latest version on the download pages or in the GitHub releases.
46+
47+
## Create a new NPC
48+
49+
### 1. Create the NPC data
50+
51+
The `NpcData` class is used to store all the information about an NPC. You can create a new instance of `NpcData` by providing a name, the UUID of the creator, and the location where the NPC should be spawned.
52+
53+
```java
54+
NpcData data = new NpcData("myNpc", creatorUUID, location);
55+
data.setSkin("OliverHD"); // use skin of the player OliverHD
56+
data.setDisplayName("<red>cool displayname</red>");
57+
```
58+
59+
### 2. Create the NPC
60+
61+
You can use the NpcData object to create a new NPC. Because the implementation of the NPC is different for every Minecraft version, FancyNpcs provides a factory to create the NPC.
62+
63+
```java
64+
Npc npc = FancyNpcsPlugin.get().getNpcAdapter().apply(data);
65+
```
66+
67+
### 3. Register the NPC
68+
69+
To let FancyNpcs handle the NPC, you need to register it. FancyNpcs will take care of spawning, despawning, saving the NPC, and more.
70+
71+
```java
72+
FancyNpcsPlugin.get().getNpcManager().registerNpc(npc);
73+
```
74+
75+
<Callout type="warn">
76+
Do not register npcs in the first few seconds after the server has started. You need to wait at least 10 seconds before registering npcs. Otherwise, the npcs will not get registered correctly.
77+
You can also listen to the `NpcsLoadedEvent` to know when you can register npcs.
78+
</Callout>
79+
80+
<Callout>
81+
If you don't want to persist the npc, you can do the following: `npc.setSaveToFile(false);`
82+
</Callout>
83+
84+
### 4. Initially spawn the NPC for all players
85+
86+
To spawn the NPC for all players, you can use the following methods.
87+
88+
```java
89+
npc.create();
90+
npc.spawnForAll();
91+
```
92+
93+
## Modify an existing NPC
94+
95+
### 1. Get the NPC object by name
96+
97+
You can get an NPC object by its name. The name is unique for every NPC (unless the `player-npcs` feature flag is enabled). Alternatively, you can get an NPC by its ID.
98+
99+
```java
100+
Npc npc = FancyNpcsPlugin.get().getNpcManager().getNpc("myNpc");
101+
NpcData data = npc.getData();
102+
```
103+
104+
### 2. Modify the NPC data
105+
106+
You can modify the NPC data object to change the NPC's properties.
107+
108+
```java
109+
data.setDisplayName("<green>new displayname</green>");
110+
data.setSkin("https://url-to-skin.com/skin.png");
111+
```
112+
113+
### 3. Update the NPC
114+
115+
After you have modified the NPC data, you need to update the NPC for all players.
116+
117+
```java
118+
npc.updateForAll();
119+
```
120+
121+
<Callout>
122+
Some changes require the NPC to be respawned. You can respawn the NPC for all players by doing the following:
123+
```java
124+
npc.removeForAll();
125+
npc.spawnForAll();
126+
```
127+
</Callout>
128+
129+
## Remove an NPC
130+
131+
To remove an NPC, you can use the following method.
132+
133+
```java
134+
FancyNpcsPlugin.get().getNpcManager().removeNpc(npc);
135+
npc.removeForAll();
136+
```
137+
138+
## JavaDocs and help
139+
140+
You can find the JavaDocs for the FancyNpcs API [here](https://repo.fancyinnovations.com/javadoc/releases/de/oliver/FancyNpcs/latest).
141+
142+
Join the [FancyInnovations Discord](https://discord.gg/ZUgYCEJUEx) for help and support. There is a dedicated channel for help about the api (`#npcs-api`).
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: v1
3+
description: The changelog of version 1
4+
---
5+
6+
## v1.0.0 (2026-XX-XX)
7+
8+
- Change 1
9+
- Change 2
10+
- Change 3
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
order: 9
3+
title: /fancyworlds
4+
description: Usage of the /fancyworlds command
5+
---
6+
7+
### Version
8+
9+
Shows the version of FancyWorlds.
10+
11+
- **Permissions**: `fancyworlds.commands.fancyworlds.version`
12+
- **Syntax**: `/fancyworlds version`
13+
14+
### Reload config
15+
16+
Reloads the config of FancyWorlds.
17+
18+
- **Permissions**: `fancyworlds.commands.fancyworlds.config.reload`
19+
- **Syntax**: `/fancyworlds config reload`
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
order: 10
3+
title: /world
4+
description: Usage of the /world command
5+
---
6+
7+
The `/world` command is the main command for managing worlds with FancyWorlds.
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: FAQ
3+
description: Frequently asked questions
4+
---
5+
6+
### Question
7+
8+
Answer
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Getting started
3+
description: Getting started with FancyWorlds
4+
---
5+
6+
<Callout type="error">
7+
Be aware, that only Paper and Folia is supported, but the plugin should work on any of its forks (like Purpur or Pufferfish). Spigot, Bukkit, Sponge and Fabric is not supported.
8+
</Callout>
9+
10+
## Installation
11+
12+
To install FancyWorlds, you need to download the latest version from one of these platforms:
13+
- [Modrinth](https://modrinth.com/plugin/fancyworlds/versions?c=release)
14+
- [Hangar](https://modrinth.com/plugin/fancyworlds/versions?c=release)
15+
- [FancySpaces](https://fancyspaces.net/spaces/fancyworlds/versions)
16+
17+
You also need to have [FancyDialogs](https://modrinth.com/plugin/fancydialogs/versions?c=release) installed on your server, as it is a required dependency for FancyWorlds.
18+
FancyDialogs is used to show fancy and interactive user interfaces, which are used in many features of FancyWorlds.
19+
20+
After downloading the plugin, you can install it by placing the downloaded file in the `plugins` folder of your server.
21+
22+
Restart your server and you are ready to go!
23+
24+
To check if the plugin is installed correctly, you can use the command `/fancyworlds version`. If the plugin is installed correctly, it will show you the version of the plugin.
25+
26+
## Create worlds
27+
28+
## Load worlds
29+
30+
## API Usage
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: ""
3+
---
4+
5+
![](/logos-and-banners/fancyworlds-banner.png)
6+
7+
<Callout>
8+
Simple, lightweight and feature-rich world management plugin for Paper and Folia servers.
9+
</Callout>
10+
11+
## Features
12+
13+
FancyWorlds offers a wide range of features to manage your worlds efficiently and easily.
14+
15+
Some of the key features include:
16+
- Create, clone and delete worlds
17+
- Load and unload worlds
18+
- Create world templates
19+
- Use custom world generators
20+
- Pre generate worlds
21+
- World portals
22+
- Change world settings (pvp, gamemode, gamerules, ...)
23+
- Take snapshots of worlds (Git but for worlds)
24+
- Many placeholders (PlaceholderAPI)
25+
26+
## Download
27+
28+
You can download the latest version of FancyWorlds from [Modrinth](https://modrinth.com/plugin/fancyworlds/versions?c=release).
29+
30+
Please make sure to always use the latest version to benefit from new features and bug fixes.
31+
Builds from the `BETA` or `ALPHA` channels are not recommended for production servers.
32+
33+
<Callout type="warn">
34+
FancyWorlds requires [FancyDialogs](https://modrinth.com/plugin/fancydialogs/versions?c=release) to work. Please make sure to also install FancyDialogs on your server.
35+
</Callout>
36+
37+
## Getting started
38+
39+
To get started with FancyWorlds, check out [this page](./fancyworlds/getting-started).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Inspiration
3+
description: Find inspirations for your projects using FancyWorlds
4+
---
5+
6+
The following examples show how to use FancyWorlds in different ways. They are meant to give you an idea of what you can do with the plugin.
7+
8+
Almost all examples are made by the community. If you have a nice example that you want to share, feel free come to our discord server and show it to us.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"title": "FancyWorlds",
3+
"icon": "",
4+
"defaultOpen": false,
5+
"pages": ["getting-started", "commands", "tutorials", "api", "changelog","inspiration", "faq"]
6+
}

0 commit comments

Comments
 (0)