Skip to content

Commit c44d68c

Browse files
committed
guilds task
1 parent d865757 commit c44d68c

7 files changed

Lines changed: 356 additions & 6 deletions

File tree

docs/guilds-tasks/conditions.mdx

Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
---
2+
title: Conditions
3+
sidebar_position: 4
4+
---
5+
6+
## Structure
7+
8+
```yaml title="tasks.yml"
9+
get_diamonds:
10+
type: block_break
11+
12+
conditions:
13+
- type: block
14+
materials:
15+
- DIAMOND_ORE
16+
- GOLD_ORE
17+
18+
rewards:
19+
- guild_xp:100
20+
```
21+
22+
We are going to focus on the `conditions` part of the task structure. <br/>
23+
24+
`Condtions` is a list of conditions written in this format:
25+
26+
```yaml
27+
- type: <condition_type>
28+
<condition_parameters>
29+
```
30+
31+
where `<condition_type>` is the type of condition and `<condition_parameters>` are the parameters for that
32+
condition. <br/>
33+
34+
## Parameters
35+
36+
Before looking at the available condition types, let's look at the parameters formats that can be used in
37+
conditions. <br/>
38+
39+
- String to value: `<parameter_name>:<value>` <br/>
40+
Example: `min-food:10` <br/>
41+
42+
- String to list of values as YAML array. <br/>
43+
Example:
44+
```yaml
45+
materials:
46+
- DIAMOND_ORE
47+
- GOLD_ORE
48+
```
49+
50+
### How do parameters work effectively?
51+
52+
You will be able to find both formats depending on the condition type. <br/>
53+
54+
In the complete documentation you will be able to find:
55+
56+
- The accepted conditions for each task
57+
- The parameter name of each condition
58+
- The accepted values and formats for each parameter (
59+
60+
:::note
61+
Keep in mind that **you can't** use a different format from the one specified in the documentation for that condition
62+
type. <br/>
63+
You can get into trouble if you try to use a different format, so please follow the documentation carefully. <br/>
64+
:::
65+
66+
## Types
67+
68+
Condition types are string values which define the type of condition. <br/>
69+
70+
:::warning
71+
The plugin actually supports ONLY the 1.8 achievements and tasks, so as of now, you can not use later achievements or
72+
tasks. <br/>
73+
We will implement features of newer versions in the future. <br/>
74+
:::
75+
76+
### General Conditions
77+
78+
These conditions will be structured using a list. <br/>
79+
In the table below, you can find the type id, the path and allowed values for each condition.
80+
81+
| Type | Path | Allowed Values | Example Values |
82+
|-------------|----------------|-----------------------------------------------------------------------------------------|-----------------------------|
83+
| achievement | `achievements` | [Achievement IDs](https://helpch.at/docs/1.8/index.html?org/bukkit/Achievement.html) | `BREW_POTION`, `KILL_ENEMY` |
84+
| biome | `biomes` | [Biome IDs](https://helpch.at/docs/1.8/index.html?org/bukkit/block/Biome.html) | `DESERT`, `FOREST`, `TAIGA` |
85+
| block | `materials` | [Material IDs](https://helpch.at/docs/1.8/index.html?org/bukkit/Material.html) | `DIAMOND_ORE`, `GOLD_ORE` |
86+
| entity | `entities` | [Entity IDs](https://helpch.at/docs/1.8/index.html?org/bukkit/entity/EntityType.html) | `CREEPER`, `ZOMBIE` |
87+
| item | `materials` | [Material IDs](https://helpch.at/docs/1.8/index.html?org/bukkit/Material.html) | `DIAMOND_ORE`, `GOLD_ORE` |
88+
| potion | `potion_types` | [Potion Types](https://helpch.at/docs/1.8/index.html?org/bukkit/potion/PotionType.html) | `SPEED`, `SLOWNESS` |
89+
90+
### Player Conditions
91+
92+
For player conditions, we usually have different parameters for each condition type. <br/>
93+
94+
<details>
95+
<summary>Player Experience</summary>
96+
97+
Condition based on the player's experience level and points.<br/>
98+
If `check-level` is true, the player's level must be within the specified range.<br/>
99+
If `check-exp` is true, the player's experience points must be within the specified range.<br/>
100+
101+
```yaml
102+
type: player_experience
103+
min-level: 10
104+
max-level: 20
105+
check-level: true
106+
107+
min-exp: 1000
108+
max-exp: 5000
109+
check-exp: true
110+
```
111+
112+
</details>
113+
114+
<details>
115+
<summary>Player Flight</summary>
116+
117+
Condition based on the player's ability to fly or flying state.<br/>
118+
If `is-flying` is true, the player must be flying.<br/>
119+
If `check-allow-flight` is true, the player must be allowed to fly.<br/>
120+
121+
```yaml
122+
type: player_flight
123+
is-flying: true
124+
check-allow-flight: true
125+
```
126+
127+
</details>
128+
129+
<details>
130+
<summary>Player Food</summary>
131+
132+
Condition based on the player's food level.<br/>
133+
`min-food` and `max-food` define the accepted food level range.<br/>
134+
135+
```yaml
136+
type: player_food
137+
min-food: 10
138+
max-food: 20
139+
```
140+
141+
</details>
142+
143+
<details>
144+
<summary>Player Game Mode</summary>
145+
146+
Condition based on the player's game mode.<br/>
147+
`gamemodes` is a list of accepted game modes: `SURVIVAL`, `CREATIVE`, `ADVENTURE`, `SPECTATOR`.<br/>
148+
149+
```yaml
150+
type: player_gamemode
151+
gamemodes:
152+
- SURVIVAL
153+
- CREATIVE
154+
```
155+
156+
</details>
157+
158+
<details>
159+
<summary>Player Health</summary>
160+
161+
Condition based on the player's health.<br/>
162+
`min-health` and `max-health` define the accepted health range.<br/>
163+
164+
```yaml
165+
type: player_health
166+
min-health: 10
167+
max-health: 20
168+
```
169+
170+
</details>
171+
172+
<details>
173+
<summary>Player Location</summary>
174+
175+
Condition based on the player's location.<br/>
176+
`worlds` is a list of accepted worlds.<br/>
177+
If `check-coordinates` is true, the player's coordinates must be within the specified min and max for x, y, z.<br/>
178+
179+
```yaml
180+
type: player_location
181+
worlds:
182+
- world1
183+
- world2
184+
185+
check-coordinates: true
186+
min-x: 100
187+
max-x: 200
188+
min-y: 50
189+
max-y: 100
190+
min-z: 100
191+
max-z: 200
192+
```
193+
194+
</details>
195+
196+
<details>
197+
<summary>Player Permission</summary>
198+
199+
Condition based on the player's permissions.<br/>
200+
`permissions` is a list of required permissions.<br/>
201+
If `require-all` is true, the player must have all listed permissions.<br/>
202+
203+
```yaml
204+
type: player_permission
205+
permissions:
206+
- guilds.tasks.test
207+
- guilds.tasks.another-test
208+
require-all: true
209+
```
210+
211+
</details>
212+
213+
<details>
214+
<summary>Player Potion Effect</summary>
215+
216+
Condition based on the player's active potion effects.<br/>
217+
`potion-effects` is a list of required effects.<br/>
218+
If `require-all` is true, the player must have all listed effects.<br/>
219+
220+
```yaml
221+
type: player_potion
222+
potion-effects:
223+
- SPEED
224+
- SLOWNESS
225+
require-all: true
226+
```
227+
228+
</details>
229+
230+
<details>
231+
<summary>Player Sneak</summary>
232+
233+
Condition based on the player's sneak state.<br/>
234+
If `is-sneaking` is true, the player must be sneaking.<br/>
235+
If `check-sneak` is true, the sneak state will be checked.<br/>
236+
237+
```yaml
238+
type: player_sneak
239+
is-sneaking: true
240+
check-sneak: true
241+
```
242+
243+
</details>

docs/guilds-tasks/configuration.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Configuration
3+
sidebar_position: 2
4+
---
5+
6+
## Configuration
7+

docs/guilds-tasks/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Home
3+
sidebar_position: 1
4+
---
5+
6+
# Guilds Tasks
7+
8+
:::warning
9+
This is the documentation for the Guilds Tasks plugin, which is a separate plugin from Guilds. <br/>
10+
Guilds is required to use Guilds Tasks.
11+
:::

docs/guilds-tasks/rewards.mdx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Rewards
3+
sidebar_position: 5
4+
---
5+
6+
## Structure
7+
8+
```yaml title="tasks.yml"
9+
get_diamonds:
10+
type: block_break
11+
12+
conditions:
13+
- type: block
14+
materials:
15+
- DIAMOND_ORE
16+
- GOLD_ORE
17+
18+
rewards:
19+
- guild_xp:100
20+
- guild_quest:2
21+
```
22+
23+
We are going to focus on the `rewards` part of the task structure. <br/>
24+
25+
`Rewards` is a list of rewards, written as a list of strings, **each element** follows the format: `{reward_type}:{value}` <br/>
26+
27+
where `{reward_type}` is the type of reward and `{value}` is the value for that reward. <br/>
28+
Value is **usually** a number, but it can also be another type of value, depending on the reward type. <br/>
29+
30+
### General Conditions
31+
32+
These conditions will be structured using a string to value format. <br/>
33+
34+
| Type | Values Type | Description | Example |
35+
|---------------|-------------|-------------------------------------|-----------------|
36+
| `xp` | Numeric | Give the player experience points. | `xp:100` |
37+
| `guild_xp` | Numeric | Add experience points to the guild. | `guild_xp:100` |
38+
| `guild_quest` | Numeric | Add progress to the guild quest. | `guild_quest:2` |
39+

docs/guilds-tasks/tasks.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: Tasks
3+
sidebar_position: 3
4+
---
5+
6+
## Structure
7+
8+
```yaml title="tasks.yml"
9+
get_diamonds:
10+
type: block_break
11+
conditions:
12+
- materials:
13+
- DIAMOND_ORE
14+
type: block
15+
rewards:
16+
- guild_xp:100
17+
```
18+
19+
Description of the task structure:
20+
21+
- `get_diamonds`: The name of the task.
22+
- `type`: The type of task, check the [task types](/guilds-tasks/tasks#types) page for more information.
23+
- `conditions`: A list of conditions that must be met for the task to be completed. Check
24+
the [conditions](/guilds-tasks/conditions#types) page for more information.
25+
- `rewards`: A list of rewards that will be given to the player when the task is completed. Check
26+
the [rewards](/guilds-tasks/rewards#types) page for more information.
27+
28+
## Types
29+
30+
Below is a list of all task types that can be used in the `type` field of a task.
31+
32+
| Type | Description |
33+
|------------------|--------------------------|
34+
| `block_break` | Break a block. |
35+
| `block_place` | Place a block. |
36+
| `entity_kill` | Kill an entity. |
37+
| `item_pickup` | Pick up an item. |
38+
| `item_craft` | Craft an item. |
39+
| `fishing` | Fish a fish. |
40+
| `achievement` | Complete an achievement. |
41+
| `enchant_item` | Enchant an item. |
42+
| `biome_enter` | Enter a biome. |
43+
| `potion_consume` | Consume a potion. |
44+
| `entity_damage` | Damage an entity. |
45+
| `entity_shoot` | Shoot an entity. |
46+
| `item_drop` | Drop an item. |
47+
48+
49+

docs/guilds/developer-api/guilds-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void onGuildTransfer(GuildTransferEvent event) {
6060
oldLeader.sendMessage("§cThe new leader is not online.");
6161

6262
event.setCancelled(true);
63-
return;
63+
return;aq
6464
}
6565
}
6666
```

sidebars.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
22
const sidebars = {
33

4-
epicachievements: [{type: 'autogenerated', dirName: 'epicachievements'}],
5-
woolwars: [{type: 'autogenerated', dirName: 'wool-wars'}],
6-
guilds: [{type: 'autogenerated', dirName: 'guilds'}],
7-
usefulstuff: [{type: 'autogenerated', dirName: 'useful-stuff'}]
8-
4+
epicachievements: [{type: 'autogenerated', dirName: 'epicachievements'}],
5+
woolwars: [{type: 'autogenerated', dirName: 'wool-wars'}],
6+
guilds: [{type: 'autogenerated', dirName: 'guilds'}],
7+
guildstasks: [{type: 'autogenerated', dirName: 'guilds-tasks'}],
8+
usefulstuff: [{type: 'autogenerated', dirName: 'useful-stuff'}]
9+
910
};
1011

1112
module.exports = sidebars;

0 commit comments

Comments
 (0)