https://github.com/httpedor/attributesetter
Minecraft mod that let's you define entity and item attributes through datapacks
https://github.com/httpedor/attributesetter
fabric forge forge-mod java minecraft minecraft-mod modding
Last synced: 5 months ago
JSON representation
Minecraft mod that let's you define entity and item attributes through datapacks
- Host: GitHub
- URL: https://github.com/httpedor/attributesetter
- Owner: httpedor
- License: other
- Created: 2024-07-14T21:14:51.000Z (12 months ago)
- Default Branch: fabric-1.20.1
- Last Pushed: 2024-12-06T17:22:50.000Z (7 months ago)
- Last Synced: 2025-01-30T16:40:49.063Z (5 months ago)
- Topics: fabric, forge, forge-mod, java, minecraft, minecraft-mod, modding
- Language: Java
- Homepage:
- Size: 140 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AttributeSetter
AttributeSetter Is a simple lightweight mod that can change the default attributes of any living entity through datapacks, inspired by [Jackiecrazy's Attributizer](https://github.com/Jackiecrazy/attributizer)
# How To Use
## Entities
Inside your datapack namespace folder, create a `attributesetter\entity` folder, and inside it, you can put as many json files as you want, with this format:
```json5
{
"minecraft:creeper": [
{
"attribute": "minecraft:generic.max_health",
"uuid": "0e1c07ef-d456-4567-b748-96b6f84b409e", //optional
"value": 5,
"operation": "BASE" // optional, default operation is BASE
},
{
"attribute": "minecraft:generic.follow_range",
"value": 10,
"operation": "ADDITION"
}
],
"#minecraft:raiders": [
{
"attribute": "minecraft:generic.max_health",
"value": 8,
"operation": "ADDITION"
}
],
"anymob": [ //This expands to "example:anymob" because of the filename
{
"attribute": "projectile_damage:generic",
"value": 10,
//default operation is BASE
}
]
}
```
This file should be at `data/example/attributesetter/entity/example.json`In the example above, all creepers will have 5 health, and +10 follow range. All entities tagged as raiders will have +8 health. The mob "example:anymob" will have 10 projectile damage.
### Object Key
Which entity ID will be changed. If the first character is a # the key is treated as a tag. If no namespace is provided, it uses the filename. For example, if I'm in file "alexsmobs.json", and I'm editing entity "void_worm", instead of typing "alexsmobs:voidworm", I can just type "voidworm"### Attribute
Which attribute should be changed, supports modded attributes.### Operation
Can be `ADDITION`, `MULTIPLY_BASE`, `MULTIPLY_TOTAL`, and `BASE`. The first three are explained in the [MC Wiki](https://minecraft.fandom.com/wiki/Attribute#Operations), and BASE means it will override the default base value for that attribute. Default is BASE## Items
Inside your datapack namespace folder, create a `attributesetter\item` folder, and inside it you can put as many json files as you want, with this format:```json5
{
"minecraft:stick": [
{
"attribute": "minecraft:generic.attack_damage",
"uuid": "0e1c07ef-d456-4567-b748-96b6f84b409e", //optional, but you should generate one if you are adding more than one modifier
"value": 5,
"operation": "ADDITION", //Optional, default value is ADDITION
"slot": "mainhand" //Optional, default value is the appropriate slot if it's an armor, or mainhand if it's not. Supports CuriosAPI(not trinkets)
},
{
"attribute": "minecraft:generic.max_health",
"value": 1,
"operation": "MULTIPLY_TOTAL",
"slot": "offhand"
}
],
"#c:swords": [
{
"attribute": "minecraft:generic.max_health",
"value": 8,
"operation": "ADDITION"
}
],
"minecraft:diamond_chestplate": [
{
"attribute": "minecraft:generic.max_health",
"value": 10
//Don't need the 'slot', it recognizes the item is equipable only in the chestplate slot and assigns the correct slot
//If you want to, you can still override the slot
}
],
"somemod:necklace": [
{
"attribute": "minecraft:generic.attack_damage",
"value": 0.5,
"operation": "MULTIPLY_BASE",
"slot": "necklace" //Curios slot
}
]
}
```
This file should be at `data/example/attributesetter/item/example.json`In the example above, all swords have +8 health, and all sticks will deal +5 damage if in the main hand, and 2x health if in the offhand.
### Object Key
Which item ID will be changed. If the first character is a # the key is treated as a tag. If no namespace is provided, it uses the filename. For example, if I'm in file "alexsmobs.json", and I'm editing item "emu_leggings", instead of typing "alexsmobs:emu_leggings", I can just type "emu_leggings"### UUID
This is how minecraft knows which item has which modifier. If you only have one modifier in the item you can ignore this, but if you have more than one, you should generate a UUID for each one. You can use [this site](https://www.uuidgenerator.net/) to generate one. BASE operation doesn't need a UUID.### Attribute
Which attribute should be changed, supports modded attributes.### Operation
Can be `ADDITION`, `MULTIPLY_BASE`, `MULTIPLY_TOTAL` and `BASE`. They are all in the [MC Wiki](https://minecraft.fandom.com/wiki/Attribute#Operations) except `BASE`, that removes all other modifiers for that attribute and sets the value to the one in the json file.### Slot
Can be mainhand, offhand, head, chest, legs, feet, or any Curios slot. Default value is mainhand, if the item's class extends ArmorItem, the default value is based on the armor slot. This means that for most armors, you don't have to specify the slot. You still have to specify the Curios slot.