RPG sample
A proof of concept of RPG mobs in the style of Wynncraft or Hypixel, shipped as a separate plugin
(graycore-rpg-sample.jar, from samples/rpg-sample/) that adds the rpg-sample module to GrayCore. It is not part of
graycore-paper.jar.
What you need
- GrayCore on the game server, and BetterModel 3.6 (it draws the 3D models and builds the resource pack).
- A web server that serves the resource pack over HTTP, with its address in
pack.publicUrl. In the dev stack, theresource-packsservice does it onhttp://localhost:8088/. - Minecraft 26.3 for the HUD's shader. The mobs and the zones work without it.
What it does
| Part | What it is | Page |
|---|---|---|
| Mobs | Mobs of the game (a zombie, a skeleton) with levels, a life of their own, damage, defense, loot and a name, or with a 3D model; skills with a warning on the ground; splitting; a mini-boss with phases. | Mobs |
| Combat | A damage model with attack, defense and critical hits, base damage and a hit interval per weapon, damage numbers. | Combat |
| Zones | Areas of the world, boxes or polygons, with sub-zones. Each one makes mobs appear near the players, shows a recommended level, and can be a safe zone. | Zones |
| HUD | The zone and the position at the top right, a card with life and mana at the top left, the mana bar in place of the hunger bar. | HUD |
| Resource pack | BetterModel's pack with the HUD's files added, published over HTTP and sent to players when they join. | For developers |
Try it
In the dev stack, accept the resource pack when you join, then:
/rpgsample list
/rpgsample spawn stone_sentinel
/rpgsample spawn stone_warden
The test platform at 2000 123 2000 in world has zones that fill with mobs when you stand on it.
Commands
/rpgsample needs graycore.commands.rpgsample.admin.
| Command | What it does |
|---|---|
/rpgsample list | Lists the mobs of mobs.yml. |
/rpgsample spawn <mob> [world x y z] | Spawns a mob at your position. The console gives the place. |
/rpgsample resize <factor> | Changes the size of every mob alive, relative to its definition. |
/rpgsample clear | Removes every mob. |
/rpgsample zones | Lists each zone and sub-zone with its levels, its mobs alive and what it spawns. |
/rpgsample where | Names the zone you stand in. |
/rpgsample pack | Sends the resource pack to you again. |
/rpgsample pack rebuild | Builds the pack again from BetterModel's file and the HUD's, publishes it and sends it to everyone. |
/rpgsample status | Mobs alive, mobs with a model, and the hash of the pack. |
Files
All in plugins/GrayCorePaper/modules/rpg-sample/, written from the plugin's defaults when they are missing and read again by
/gcadmin reload:
| File | What it holds |
|---|---|
config.yml | blockNaturalSpawns, combat:, pack: and hud:. |
mobs.yml | The mobs. |
zones.yml | The zones and the mobs of each. |
hud.yml | The lines of the HUD. |
locale/en.yml | The texts. |
A mob spawned before a reload keeps the settings it had. The same files are described setting by setting on the pages above.
Limits
- Mobs are not saved: they disappear with their chunk or on a restart, and the zones fill up again.
- A recommended level is shown, nothing stops a player from going in.
- A player's level and mana are placeholders (
hud.mockLevel,hud.mockMana) until players have stats of their own.