All Mods Resource Packs Data Packs Shaders Modpacks Plugins
AttributeSetter

AttributeSetter

by httpedor • Downloads: 0 • Followers: 0
Description
Gallery
Changelog
Versions

Summary

Attribute Setter Is a simple lightweight mod that can change the default attributes of any living entity or item through datapacks, inspired by Jackiecrazy's Attributizer and Custom Item Attributes(CIA). This mod was created for modpack creators and server owners to easily balance entities and items, changing their health, damage, follow range, etc...

Supports CuriosAPI

Although we(I) don't support trinkets yet(it's harder to implement, trinkets doesn't have the event that I use in Curios), if you want to add attributes to any curios, just set the slot to the appropriate name.

Server Side Only Required

If you are a server owner, your players DO NOT need to download this mod. Simply put it into your mods folder and configure it as you wish. Of course it works on singleplayer as it has an integrated server running. Although keep in mind that your players won't see the changed attributes, they'll still work, but the items will appear with their vanilla attributes.

Client Side Optional

If installed in client-side, besides showing the changed attributes, this mod also collapses item attributes into vanilla "green attributes" if they're already present

Vanilla Behaviour AttributeSetter

Example

The following file attributes.json will change all creepers' health to 100, instead of the normal 20.

{
    "minecraft:creeper": [
        {
            "attribute": "minecraft:generic.max_health",
            "value": 100,
            "operation": "BASE"
        }
    ]
}

Creeper has spawned with 100 health

For more info on how to configure AttributeSetter, visit the github page or the discord

If you are building a modpack

you might be interested in some of my other mods for modpacks: AttributeSetter RPGDamageOverhaul FoodAttributes

Or Claims n Raids for servers/smp!

All Versions

+ Add Version
Name Game version Platforms Published Downloads Actions
1.21.1
Neoforge
2mo ago 1
1.21.1
Neoforge
4mo ago 1
1.21.1
Neoforge
5mo ago 1
1.20.1
Fabric
6mo ago 1
1.21.1
Neoforge
6mo ago 1
1.20.x
Forge
7mo ago 1
1.20.x
Forge
9mo ago 1
1.20.x
Forge
9mo ago 1
1.21.x
Neoforge
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.1
Forge Neoforge
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.1
Forge
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.1
Forge
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.1
Forge
last yr. 1
1.20.1
Forge
last yr. 1
1.20.x
Forge
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.x
Forge
last yr. 1
1.20.1
Forge
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.1
Forge
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.1
Fabric Quilt
last yr. 1
1.20.1
Fabric Quilt
last yr. 1
1.20.1
Fabric Quilt
last yr. 1
1.20.1
Fabric Quilt
last yr. 1
1.20.1
Fabric Quilt
last yr. 1
1.20.1
Fabric
last yr. 1
# AttributeSetter 2.3
## Block editing (new folder: attributesetter/block)

A new target type for changing block properties. Blocks have no NBT or data components, so those selectors are unavailable here, but id, tag, regex, @namespace, *, and the ! / && / || combinators all work.

  • Hardness**: retunes destroySpeed with multiplier (default 1.0) and offset (default 0.0), result clamped to zero or above. Blocks vanilla marks unbreakable are skipped unless you pass an explicit value.
  • Explosion resistance**: same multiplier/offset rules on explosionResistance. Alias blast_resistance.
  • Mining speed**: applies multiplier/offset to the player's dig speed through the break-speed event. This one is per player, dynamic, and stacks with other break-speed modifiers. Alias break_speed.
  • Replace**: swaps a block for another every time it generates or is placed (worldgen, entity and dispenser placement, pistons, fluids). Blocks already in loaded chunks convert when the game next writes that position.
  • Remove**: REMOVE / DELETE in the block folder turns every generated or placed copy into air and removes the block's item.

## Recipe editing (new folder: attributesetter/recipe)

Select recipes, then remove or rewrite them. Edits apply during the datapack reload and ride the game's own recipe sync to clients, so /reload is enough and deleting the entry restores the recipe.

  • Remove**: { "minecraft:diamond_sword": "remove" }.
  • Replace result**: replace_result with with and count. Accepts a full item string, so components work.
  • Replace ingredient**: replace_ingredient with match (an item selector, every matching ingredient is swapped) and with (an id, #tag, or array).
  • New recipe selectors: recipe id (minecraft:x, regex:, @mod, combinators), type:minecraft:smelting / recipe_type, recipe_type_regex, ingredient: / contains_ingredient, result: / contains_result. The ingredient and result matchers take a full item selector as their value.
  • replace_result and replace_ingredient rebuild the recipe, so they cover shaped and shapeless crafting, smelting/blasting/smoking/campfire, and stonecutting. A recipe type the mod cannot rebuild is left alone with a log warning. remove works on any recipe.

## Removing items, entities, and blocks

REMOVE / DELETE was expanded well past what 2.2.1 did.

A removed **item** now disappears from:

  • the creative inventory and creative search, and therefore JEI
  • every recipe (recipes producing it are dropped, and recipes that can no longer be crafted because an ingredient lost all its items are dropped, but a tag ingredient that only lost one item is kept)
  • every loot table (block, mob, chest, fishing, gift rolls)
  • villager and wandering trader offers
  • the world (dropped item entities are deleted as they spawn)
  • player inventories and ender chests, swept once a second, so pre-existing copies go away too

A removed **entity** never joins a level (natural spawns, spawners, spawn eggs, breeding, entities already saved in a chunk). Its spawn egg is removed as an item, and the spawn placement check denies it early so it does not eat the mob cap. Players are never removed.

Removals recompute from scratch on every /reload, and loot tables and recipes are filtered rather than rewritten, so deleting the entry brings everything back. The two things that do not come back: trades already stripped off a villager, and items already swept out of an inventory. Spawn-egg removal and the early placement check need a selector that resolves to entity types on its own (id, tag, regex, mob category, and their combinations); an entity entry relying only on NBT or isEnemy still removes the entity but skips those two extras.

## Unique caps (make_unique / make_unique_shared)

Caps how many copies of an item or entity may ever be created in a save. Past the cap, new copies are blocked the way a removed thing is, but the item stays in the creative tab and JEI, and creative grabs and /give do not count.

  • make_unique (alias unique): the limit applies to each matched type on its own.
  • make_unique_shared (alias unique_shared): pools every type the entry matched into one counter.
  • Fields: limit (required), broadcast (announce in chat on hitting the cap), message (custom text with %name%, %limit%, %count% placeholders).
  • What counts: items count when produced by a loot table or a crafting recipe; entities count on spawn (natural, spawner, breeding, spawn egg, /summon). Over-cap loot rolls drop the item, over-cap crafting yields nothing, over-cap spawns are denied. Counted unique entities are marked persistent so they never despawn.
  • Counting is lifetime and monotonic per save. Destroying a copy does not free a slot. Counts are stored in the overworld's saved data, so they survive restarts and /reload. Removing the datapack entry drops the cap but keeps the count.
  • Entities already saved in a chunk before the cap existed are grandfathered in, not culled or counted.
  • New command: /attributesetter unique <item|entity|group> <id> [get | set <n> | add <n> | remove <n> | reset], permission level 2. With no verb it prints the count and the active limit.
  • New server config config/attributesetter-server.toml with defaultBroadcastMessage and broadcastByDefault.

## Selectors

Selectors now work out what they support from what the target actually is, rather than being listed per folder. Because an item stack is a specific item, every item selector (id, tag, regex, namespace, isFood, and so on) works on item stacks with no extra work.

A selector can now be written three ways that mix freely:

  • a string (the existing shorthand)
  • an object with a type field for one selector spelled out, or without a type for "all of these at once"
  • an array, which matches if any entry matches

Object-form options: invert: true flips a selector, specificity (alias priority) overrides how specific it counts as for ordering.

New and expanded selectors:

  • @somemod / {"namespace": "somemod"} for everything a mod added
  • * / {"type": "always"} for everything
  • component:minecraft:food / has_component for any data component by id, a list meaning "has all of them"
  • more item component checks: isTool, isDyeable, isFireResistant, hasAttributes, alongside the existing isFood, hasDurability, isEnchanted, isPotion
  • a word for every vanilla mob category: isMonster, isCreature, isAmbient, isWaterCreature, and the rest, plus {"mob_category": [...]}
  • regex gained ignore_case and match set to full (default), path, or namespace
  • NBT can be written as a plain JSON object ({"IsBaby": 1}) as well as SNBT
  • not, any, and all nest to any depth, and each entry is itself a full string, object, or array selector

## File format and shorthands

  • A single setter no longer needs to be wrapped in an array.
  • A setter can be written as a string. Grammar is <operation> [token]..., where a token is key=value, x2 / *2 (multiplier), +5 / -5 (offset), or a positional argument. Double quotes group a token with spaces. Covers remove, unique 3, durability x2, max_stack 16, hardness x0.5, attribute minecraft:generic.max_health 40, tooltip <line>, replace_ingredient <match> <with>, and more.
  • A selector can be a JSON object when the entry carries a selector field (aliases select, target), turning the key into a plain label, or the whole file can be an array of entries.
  • setters aliases: apply, modifiers, operations. operation alias op.
  • An entry can carry name (alias id) used as its label in modifier ids and log lines instead of the array index.
  • Keys starting with an underscore are ignored, so "_comment" works as a note.
  • File and entry priority**: a top-level integer priority key sets the default for every entry in the file, and an individual entry can override it. Matching entries apply lowest priority first, so a higher-priority entry applies last and overrides the ones it overlaps with, whatever their selectors look like. This is how one datapack can override or effectively delete another datapack's entry. Ties fall back to specificity ordering. This is separate from the priority alias for specificity inside a selector object.
  • The item folder now accepts both per-stack operations (attribute modifiers, tooltips) and per-item operations (durability, food, stack size); each setter is handed to whichever half understands it. item_type still works and still means item-level only. Plural folder names (entities, items, blocks, recipes, attributes) are accepted.

## Curios

  • New slot value "curio" (also "curio:*") applies the modifier in every Curios slot the item fits, without naming one. This never depends on Curios' slot list, so it is the reliable option for multi-slot items.
  • Reworked the "slot omitted" path. When Curios' slot data has not loaded yet, the entry is registered both as a Curios entry and as a normal item modifier, and the choice is made per attribute query with a logged warning, instead of guessing wrong at load time. That fallback skips the reload-time bake into ATTRIBUTE_MODIFIERS, so writing the slot out explicitly is still better.
  • CuriosCompat was substantially rewritten around this.

## Fixes

  • Armor modifiers were invisible to the mod.** ArmorItem and every mod item copying its shape keep their modifiers in a memoized supplier, not in the ATTRIBUTE_MODIFIERS component, so reading the component alone reported every armor piece as having no modifiers. TrueDefaults now resolves modifiers the same way NeoForge's ItemStack#getAttributeModifiers does, falling back to getDefaultAttributeModifiers, and snapshots them before any reload so a bake cannot be counted twice.
  • Reading an ingredient during the reload corrupted recipes for the session.** Ingredient#getItems() resolves tag ingredients against registry tags and caches the result forever, but the server only binds the reload's tags after every reload listener finishes. Calling it from the mod's listener dissolved tag ingredients against the previous reload's tags, or against nothing on first world load. New IngredientItems helper reads ingredient contents from the reload's own condition context instead, and recipe matching and removal both go through it now.
  • Attribute tooltip lines were duplicated or left stranded.** The client tooltip code now rebuilds the "When in Main Hand" block from real modifier data instead of scraping localized text, and it accounts for NeoForge replacing vanilla's attribute tooltip section with its own. Missing translation-key prefixes had made the section scan stop early and leave the original lines below the merged block. It also restores the original lines if anything goes wrong, so it will not break another mod's tooltip.
  • Durability and max-stack setters reworked to the shared value / multiplier / offset model used by the block setters.

## Internal

  • New util classes: JsonHelper, Shorthand, RecipeRewriter, RegistryValues, IngredientItems.
  • New API classes: BlockDefaults, BlockReplacementRegistry, RecipeProcessor, UniqueRegistry, UniqueCounts, expanded RemovalRegistry and TargetType.
  • New selectors: AlwaysSelector, NamespaceSelector, ProjectedASSelector, EntityTypeResolver, and the recipe selector package (IngredientSelector, RecipeTypeSelector, ResultSelector, RecipeMatching).
  • Per-target-type classes under targettypes/ (BlockTargetType, RecipeTargetType, and friends).
  • New mixins: BlockBehaviourAccessor, BlockStateBaseAccessor, LevelChunkMixin, ProtoChunkMixin, CreativeModeTabMixin, LootTableMixin, AbstractVillagerMixin.
  • TargetType.registerEntry now takes a priority and flattens composite setters before bucketing them by event, so a builder can return one composite holding setters for different events.
  • Version bumped 2.2.1-neoforge to 2.3-neoforge.
Fixed setters trying to register before TargetTypes are loaded

Fixed AttributeInjection duration and stacking glitch

Fixed concurrent access crash on AttributeSetterAPI usage

Rewrite of the project.

Added food setters
Added tooltip setters
Added caching for a bunch of Selectors(HUUUGE performance boost)
Added Attribute Merging
Added isEnemy selector
Added MaxStack setter
Added isFood selector
Added hasDurability selector
Added isEnchanted selector
Added isPotion selector
Added isMonster selector
Added isCreature selector
Better support for /reload
New documentation
  • Fixed attributes not being applied to baby entities
  • Added regex selectors
  • Added attribute conversion
  • Added attribute dependency
  • MANY bugfixes, too many to list.
  • Better compat with ApothicAttributes
  • Better attribute merging
  • Better performance(rewrote the entire project)
  • The ability to select items and entities based on NBT
  • The ability to select items and entities based on more than one tag(or nbt) at once
  • The ability to select all items and entities that DON'T fit the selector
  • The "durability" operator, which changes an item's max durability.
Attempt at a 1.21 port. Tooltip rendering is not working just yet!
Fixed bug where attributes weren't stacking in different armor pieces

Removed need for UUIDs altogether, although you can still specify them
Fixed bug where attributes weren't stacking in different armor pieces

Removed need for UUIDs altogether, although you can still specify them

Fixed bug where if you had two items in the same curios slot(E.g two rings) the attributes didn't stack
Many bugfixes
Bug fixes

Changed how curio slots works, check Github
Added shorthand entity and item ids based on filename

Entity default operation now is BASE

Fixed wrong values appearing as green attributes
Added shorthand entity and item ids based on filename

Entity default operation now is BASE

Fixed wrong values appearing as green attributes
Fixed a crash about non number attribute tooltips
Fixed a crash about non-number attribute tooltips
Added support for CuriosAPI
Fixed attributes not showing up when clients are connected to server.
Fixed clients not showing correct attributes when connected to a server
Fixed incompatibilities with some mods.
Fixed some incopatibilities
Added auto-slot recognition so you don't have to manually type the slot for every armor attribute.
Added auto-slot recognition, so you don't have to manually type the slots for each armor attribute.
Added support for forge!
[1.5] AttributeSetter 1.5 by httpedor on Aug 21, 2024
Download
Fixed UUID problem
Negative modifiers now collapse into green modifiers
Fixed crash in server
[1.4] AttributeSetter 1.4 by httpedor on Aug 04, 2024
Download
Added changes tooltips to correctly display attributes in tools.

THIS VERSION CRASHES ON SERVERS, DOWNLOAD THE 1.4 HOTFIX
[1.3] AttributeSetter 1.3 by httpedor on Aug 03, 2024
Download
Added BASE option for items.
[1.2] AttributeSetter 1.2 by httpedor on Jul 30, 2024
Download
Removed some console spam

Added default tags for some MC entities
[1.1] AttributeSetter 1.1 by httpedor on Jul 21, 2024
Download
Renamed the whole project to AttributeSetter
Added support for Item Attributes
AttributeSetter Icon
Download AttributeSetter
Select game version
Select platform