Skip to content

Commit

Permalink
Add examples to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Blitheness committed Jul 13, 2021
1 parent d80de95 commit b30340f
Showing 1 changed file with 114 additions and 3 deletions.
117 changes: 114 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Minecraft Stats Scripts
## Overview
Scripts to parse Minecraft statistics and advancement JSON files, and send relevant information to an API endpoint.
Scripts to parse Minecraft statistics and advancement JSON files, and send relevant information to an API endpoint. The API receiving the data can then decide how to further process it, according to the needs of the application.

## Requirements
- PHP 8.0
- PHP Ctype and intl extensions
- [Composer](https://getcomposer.org)
- [Composer](https://getcomposer.org "Dependency Manager for PHP")

## Usage
1. Clone this repository
Expand All @@ -22,4 +22,115 @@ or (short-hand arguments):
php index.php -d "/home/minecraft" -w "world"
```

The working directory argument is optional. It will default to the directory where the script is located.
The working directory argument is optional. It will default to the directory where the script is located.

## Example API Calls
### Advancements
```
POST /api/advancements HTTP/1.1
User-Agent: minecraft-stats-scripts/0.1.0
Accept: application/json
Content-Type: application/json
{
"adventure/sleep_in_bed": {
"complete": true,
"completed_at": {
"date": "2021-07-03 16:54:09.000000",
"timezone_type": 1,
"timezone": "+00:00"
}
},
"husbandry/tame_an_animal": {
"complete": true,
"completed_at": {
"date": "2021-07-04 13:45:10.000000",
"timezone_type": 1,
"timezone": "+00:00"
}
},
"husbandry/make_a_sign_glow": {
"complete": true,
"completed_at": {
"date": "2021-07-05 09:13:38.000000",
"timezone_type": 1,
"timezone": "+00:00"
}
},
"husbandry/balanced_diet": {
"complete": false,
"completed_at": null
},
"husbandry/bred_all_animals": {
"complete": false,
"completed_at": null
}
}
```

### Statistics (Skills)
```
POST /api/statistics HTTP/1.1
User-Agent: minecraft-stats-scripts/0.1.0
Accept: application/json
Content-Type: application/json
{
"mining": {
"coal": 513,
"copper": 14,
"diamonds": 39,
"glowstone": 30,
"gold": 90,
"iron": 335,
"lapis": 19,
"quartz": 245,
"redstone": 238
},
"farming": {
"breeding": 370,
"carrots": 8,
"hoe_used": 19,
"melon": 1,
"potatoes": 2,
"pumpkin": 1,
"sugar_cane": 567,
"wheat": 1783
},
"slayer": {
"creeper": 49,
"drowned": 17,
"enderman": 2412,
"ender_dragon": 0,
"hoglin": 0,
"husk": 2,
"magma_cube": 156,
"phantom": 10,
"piglin": 0,
"pillager": 0,
"silverfish": 0,
"skeleton": 273,
"slime": 0,
"spider": 47,
"vindicator": 0,
"witch": 1,
"wither": 0,
"wither_skeleton": 9,
"zombie": 128
},
"cooking": {
"beef": 0,
"bread": 63,
"cake": 0,
"chicken": 0,
"cookie": 0,
"fish": 0,
"kelp": 0,
"mutton": 0,
"porkchop": 0,
"potato": 0,
"rabbit": 0,
"stew": 0
}
}
```

0 comments on commit b30340f

Please sign in to comment.