attributesetter-2.3-neoforge.jar
Curse Maven Snippet
What's new
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
destroySpeedwithmultiplier(default 1.0) andoffset(default 0.0), result clamped to zero or above. Blocks vanilla marks unbreakable are skipped unless you pass an explicitvalue. - Explosion resistance: same multiplier/offset rules on
explosionResistance. Aliasblast_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/DELETEin theblockfolder 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_resultwithwithandcount. Accepts a full item string, so components work. - Replace ingredient:
replace_ingredientwithmatch(an item selector, every matching ingredient is swapped) andwith(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_resultandreplace_ingredientrebuild 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.removeworks 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(aliasunique): the limit applies to each matched type on its own.make_unique_shared(aliasunique_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.tomlwithdefaultBroadcastMessageandbroadcastByDefault.
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
typefield for one selector spelled out, or without atypefor "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 everythingcomponent:minecraft:food/has_componentfor any data component by id, a list meaning "has all of them"- more item component checks:
isTool,isDyeable,isFireResistant,hasAttributes, alongside the existingisFood,hasDurability,isEnchanted,isPotion - a word for every vanilla mob category:
isMonster,isCreature,isAmbient,isWaterCreature, and the rest, plus{"mob_category": [...]} regexgainedignore_caseandmatchset tofull(default),path, ornamespace- NBT can be written as a plain JSON object (
{"IsBaby": 1}) as well as SNBT not,any, andallnest 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 iskey=value,x2/*2(multiplier),+5/-5(offset), or a positional argument. Double quotes group a token with spaces. Coversremove,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
selectorfield (aliasesselect,target), turning the key into a plain label, or the whole file can be an array of entries. settersaliases:apply,modifiers,operations.operationaliasop.- An entry can carry
name(aliasid) 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
prioritykey 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 thepriorityalias forspecificityinside a selector object. - The
itemfolder 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_typestill 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. CuriosCompatwas substantially rewritten around this.
Fixes
- Armor modifiers were invisible to the mod.
ArmorItemand every mod item copying its shape keep their modifiers in a memoized supplier, not in theATTRIBUTE_MODIFIERScomponent, so reading the component alone reported every armor piece as having no modifiers.TrueDefaultsnow resolves modifiers the same way NeoForge'sItemStack#getAttributeModifiersdoes, falling back togetDefaultAttributeModifiers, 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. NewIngredientItemshelper 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/offsetmodel used by the block setters.
Internal
- New util classes:
JsonHelper,Shorthand,RecipeRewriter,RegistryValues,IngredientItems. - New API classes:
BlockDefaults,BlockReplacementRegistry,RecipeProcessor,UniqueRegistry,UniqueCounts, expandedRemovalRegistryandTargetType. - 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.registerEntrynow 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-neoforgeto2.3-neoforge.
All Relations
- All Relations
- Embedded Library
- Optional Dependency
- Required Dependency
- Tool
- Incompatible
- Include

