diff --git a/.gitignore b/.gitignore index f167d06..0ca7755 100644 --- a/.gitignore +++ b/.gitignore @@ -114,4 +114,5 @@ run/ # Gradle stuff .gradle -build \ No newline at end of file +build +/Bucket_Mobs_Resource_Pack/ \ No newline at end of file diff --git a/README.md b/README.md index 03caf6e..4d99121 100644 --- a/README.md +++ b/README.md @@ -2,89 +2,144 @@ [![wakatime](https://wakatime.com/badge/user/1f3b44b5-611a-484d-bcdc-b2084eefec1a/project/2a7588f5-f1d8-4dae-aa7b-fea0bf437f78.svg)](https://wakatime.com/@1f3b44b5-611a-484d-bcdc-b2084eefec1a/projects/szguvxhtkl) -Throw mobs into buckets! :D +Throw mobs into buckets - like axolotls, but for everything else. -## Permissions -| Permission | What it do | Default | -|---------------------------------|--------------------------------------------------|---------| -| `simplebucketmobs.bucket.` | Allows the user to bucket the specified mob | `false` | -| `simplebucketmobs.bucket.all` | Allows the user to bucket all enabled mobs | `op` | -| `simplebucketmobs.reload` | Reload plugin configuration files | `op` | -| `simplebucketmobs.debucket` | Dump saved mob NBT data from Mob Bucket to chat. | `op` | +Right-click a mob with an empty bucket to capture it. Right-click a block to release it. + +## Commands + +| Command | Description | Permission | +|---|---|---| +| `/sbm reload` | Reload all configuration files | `simplebucketmobs.reload` | +| `/sbm debucket` | Print NBT debug info for the bucket mob in your hand | `simplebucketmobs.debucket` | -## Texture Configuration +Aliases: `/simplebucketmobs`, `/simplebucketmob` + +## Permissions -This configuration is `texture.yml` which is specifically used for custom model data. Currently, the custom model data is applied to a bucket. +| Permission | Description | Default | +|---|---|---| +| `simplebucketmobs.bucket.` | Bucket a specific mob type (e.g. `simplebucketmobs.bucket.sheep`) | `false` | +| `simplebucketmobs.bucket.all` | Bucket all enabled mob types | `op` | +| `simplebucketmobs.reload` | Reload configuration files | `op` | +| `simplebucketmobs.debucket` | Dump saved mob data to chat | `op` | -The texture configuration is made to be customizable in the event you wanted to make special textures for each variant of a mob. +Per-mob permissions are only checked when `requires-permission: true` is set for that mob in `config.yml`. -For example, if you wanted to set a special blue sheep texture, rather than just having a generic texture for all sheep. +## Configuration (`config.yml`) -### Using "default" +### Captured Item Style -The simplest way to assign custom model data is to use the default option. +Controls the appearance of the bucket item produced when a mob is captured. ```yaml -SHEEP: - default: 1 -PIG: - default: 2 +captured-item-style: + use-resource-pack: true # Apply item-model from texture.yml (requires a resource pack) + default: + item-type: BUCKET # Material of the bucket item + item-model: "minecraft:bucket" # Fallback item model (NamespacedKey) + name: " in a Bucket" # MiniMessage display name + lore: + - "A sits in the bucket" + enchantment-glint: true # Whether the item has an enchantment glint ``` -This is the easiest way to set it and will set it to all mobs of that type. -In the above example, all sheep will have custom model data 1 and all pigs will have custom model data 2. +**Name placeholders:** -### Using the nbtKey and nbtValue +| Placeholder | Example output | +|---|---| +| `` | `SHEEP` | +| `` | `Sheep` | +| `` | Custom name if set, otherwise the mob's default display name | -nbtKey and nbtValue are the ways I will be referring to the NBT Tags. nbtValue is our "goal". The examples are simplified by removing the extra JSON. +### Mob Rules (`bucket-type-settings`) -Consider a villager's profession... +Controls which mobs can be bucketed and under what conditions. -```json -{ "VillagerData": {"level":1, "profession":"minecraft:none", "type":"minecraft:desert"} } +```yaml +bucket-type-settings: + default: + allow: false + sneak-required: false + pickup-when-aggro: false + requires-permission: false + types: + SHEEP: + allow: true + VILLAGER: + allow: true + sneak-required: true # Player must be sneaking to bucket this mob + requires-permission: true # Checks simplebucketmobs.bucket.villager + SLIME: + allow: true + pickup-when-aggro: true # Can be bucketed even when targeting the player ``` -If we want to differentiate custom model data based on a villager's profession, our nbtValue will be "minecraft:none" in this example. +Valid entity type names follow the [Bukkit EntityType enum](https://purpurmc.org/javadoc/org/bukkit/entity/EntityType.html). The following are always blocked regardless of config, since they are already bucketable in vanilla: `TROPICAL_FISH`, `SALMON`, `COD`, `AXOLOTL`, `PUFFERFISH`, `TADPOLE`. + +## Texture Configuration (`texture.yml`) + +`texture.yml` maps mob types (and their variants) to item model keys. These keys are [NamespacedKeys](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/NamespacedKey.html) pointing to models in your resource pack. `use-resource-pack` in `config.yml` must be `true` for these to apply. + +The default values reference the [Bucket Mobs Resources](https://modrinth.com/resourcepack/bucket-mobs-resources/versions) resource pack. -You would get to the nbtValue using all the nbtKeys along the way. This will look like this in your `texture.yml`... +### Basic format + +Every mob entry supports a `default` key used as the fallback when no variant matches: ```yaml -VILLAGER: - VillagerData: - profession: - "minecraft:none": 1 +blaze: + default: "simplexity:bucket_mobs/misc/blaze" ``` -As shown above, you can use any information stored in the NBT tags to differentiate specific variants of a mob. Here are a few more examples... +### Variant format -**Parrot (Variant)** +For mobs whose variant is recognized by the plugin (see table below), sub-keys under `type` are matched against the variant name: -```json -{ "Variant": 1 } -``` ```yaml -PARROT: - default: 0 - Variant: - 1: 1 +frog: + default: "simplexity:bucket_mobs/frog/cold" + type: + cold: "simplexity:bucket_mobs/frog/cold" + temperate: "simplexity:bucket_mobs/frog/temperate" + warm: "simplexity:bucket_mobs/frog/warm" ``` -**Sheep (Color)** +### Supported variant lookups + +| Mob | `type` key format | Example keys | +|---|---|---| +| Cat | `Cat.Type` enum, lowercase | `tabby`, `black`, `red`, `siamese`, `british_shorthair`, `calico`, `persian`, `ragdoll`, `white`, `jellie`, `all_black` | +| Fox | `Fox.Type` enum, lowercase | `red`, `snow` | +| Frog | `Frog.Variant` enum, lowercase | `cold`, `temperate`, `warm` | +| Horse | `_