
Itematic
A mod that adds data-driven items to the game, and much more!
Список изменений
There's no version for 1.21.1 this time because I want to be up-to-date during 26.x updates before the end of the year (ergo before 27.1 happens). This version overhauls the action context parameter system by using the vanilla context instead. It also introduces entity spawn rules, unifies spawn-related fields in item behaviour components that involve placing entities and changes the way buckets are defined.
For a few more details regarding the split and future you can look at the roadmap to 1.21! However, expect a small update on this sooner or later.
Changes
- Removed smithing templates.
- This only provided the tooltip and textures, of which the former has been extracted from the behaviour entirely.
Items
- Removed
#minecraft:prevent_mining_in_creative- Its functionality is now part of
minecraft:tool.
- Its functionality is now part of
Item Behaviour Components
-
Replaced usages of entity initialisers with entity types directly.
-
Removed the following item behaviour components:
minecraft:pointable- This should now be replicated with item assets in resource packs.
- Setting the item pointer location should now be replicated with actions instead.
minecraft:saddle- This has been replaced entirely by
minecraft:equipment.
- This has been replaced entirely by
minecraft:tinted- This should now be replicated with item assets in resource packs.
-
Renamed
minecraft:smithing_templatetominecraft:smithing_template_provider.- It now only references the type, which was previously present in smithing templates.
- Now only determines the textures used in a Smithing Table.
- The tooltip is also no longer provided by the behaviour and must be placed in the item display instead.
So if you had this:
{
"minecraft:smithing_template": {
"template": "minecraft:bolt_pattern"
}
}
You now have to use this:
{
"minecraft:smithing_template_provider": "minecraft:trim_pattern"
}
minecraft:attack_blocking
- Blocks attacks when used.
- The fields are the same as the
minecraft:blocks_attacksdata component.
Example:
{
"minecraft:attack_blocking": {
"block_delay_seconds": 0.25,
"block_sound": "minecraft:item.shield.block",
"bypassed_by": "#minecraft:bypasses_shield",
"disabled_sound": "minecraft:item.shield.break",
"item_damage": {
"base": 1.0,
"factor": 1.0,
"threshold": 3.0
}
}
}
minecraft:bucket
- Unified block and fluid placement for buckets.
- The
fluid,blockandtransforms_intofields have been replaced with world modifications in the newmodificationfield.- This means that the previously hardcoded behaviour of the
minecraft:emptyfluid draining a fluid instead has been removed.
- This means that the previously hardcoded behaviour of the
| Previously set field | World modification |
|---|---|
Fluid minecraft:empty | minecraft:drain_fluid |
| Any other fluid | minecraft:place_fluid with the specified fluid |
| Any block | minecraft:place_block with the specified block |
- Moved the placed entity up a level by replacing it with an entity spawner.
- This means that the optional
require_other_successful_placementfield has been removed and now always requires a successful placement. - The field itself is still optional.
- This means that the optional
So if you had this:
{
"minecraft:bucket": {
"emptying_sound_event": "minecraft:item.bucket.empty_fish",
"entity": {
"entity": {
"type": "minecraft:pufferfish"
},
"require_other_successful_placement": true
},
"fluid": "minecraft:water",
"transforms_into": "minecraft:bucket"
}
}
You now have to use this:
{
"minecraft:bucket": {
"entity": {
"entity": "minecraft:pufferfish"
},
"modification": {
"type": "minecraft:place_fluid",
"fluid": "minecraft:water",
"place_sound": "minecraft:item.bucket.empty_fish",
"transforms_into": "minecraft:bucket"
}
}
}
minecraft:entity
- Merged the
entityandallow_item_datafields into a singleentityfield by using an entity spawner. - Added
allow_spawner_modification.- Its value is an optional boolean defaulting to
false. - Determines whether the item can modify a Spawner's entity type.
- Its value is an optional boolean defaulting to
So if you had this:
{
"minecraft:entity": {
"allow_item_data": true,
"entity": {
"type": "minecraft:pig"
},
"passes": [
"block",
"fluid"
]
}
}
You now have to use this:
{
"minecraft:entity": {
"allow_spawner_modification": true,
"entity": {
"allow_item_data": true,
"entity": "minecraft:pig"
},
"passes": [
"block",
"fluid"
]
}
}
minecraft:playable
- Renamed
instrumentstodefault_instrumentand now only accepts one instrument.
minecraft:projectile
- The
entityfield now only accepts an entity type instead of an entity initialiser by making the entire component an entity spawner. - This means it also gains the other optional fields. So if you had this:
{
"minecraft:projectile": {
"entity": {
"type": "minecraft:trident"
}
}
}
You now have to use this instead:
{
"minecraft:projectile": {
"entity": "minecraft:trident"
}
}
Example using data components:
{
"minecraft:projectile": {
"components": {
"minecraft:chicken/variant": "minecraft:cold"
},
"entity": "minecraft:egg"
}
}
minecraft:spawn_egg
- Is no longer required for Spawner entity type modification.
- This field has instead been moved to the
minecraft:entityitem behaviour component.
- This field has instead been moved to the
- The behaviour component is still used for spawning children when used on the specified entity type.
So if you had this:
{
"minecraft:entity": {
"allow_item_data": true,
"entity": "minecraft:pig",
"passes": [
"block",
"fluid"
]
},
"minecraft:spawn_egg": {}
}
You now have to use this:
{
"minecraft:entity": {
"allow_spawner_modification": true,
"entity": {
"allow_item_data": true,
"entity": "minecraft:pig"
},
"passes": [
"block",
"fluid"
]
},
"minecraft:spawn_egg": {}
}
minecraft:text_holder
- Now opens a book on use directly instead of needing an action.
minecraft:trim_material_provider
- Provides a trim material for use in recipes.
- Its value is an id pointing to a trim material.
- This value can be changed for individual item stacks in the new
minecraft:provides_trim_materialdata component.
Example:
{
"minecraft:trim_material_provider": "minecraft:diamond"
}
minecraft:weapon
- Renamed the
damage_per_attackfield toitem_damage_per_attack. - Added the
disable_blocking_for_secondsfield.- Disables blocking when used on a target wielding an item that is attack blocking.
- Its value is a non-negative float.
Actions
- Removed action context parameters in favour of entity targets and new position targets.
- These values need to be updated accordingly.
- There is more information on this in the Entity Targets section below.
So if you had this:
{
"type": "minecraft:play_sound",
"category": "neutral",
"pitch": 1.0,
"position": "this",
"sound": "minecraft:item.bottle.fill",
"volume": 1.0
}
You now have to use this instead:
{
"type": "minecraft:play_sound",
"category": "neutral",
"pitch": 1.0,
"position": "origin",
"sound": "minecraft:item.bottle.fill",
"volume": 1.0
}
- Various actions gained fields for entity targets.
- Exchanging stacks now works in more places and in more contexts.
- Simplified action requirements to only take a predicate due to the migration towards context parameters.
So if you had this:
{
"requirements": {
"conditions": {
"condition": "minecraft:location_check",
"predicate": {
"block": {
"blocks": "minecraft:respawn_anchor"
}
}
},
"context": {
"entity": "this",
"position": "target"
}
}
}
You now have to use this instead:
{
"requirements": {
"condition": "minecraft:location_check",
"position": "interacted",
"predicate": {
"block": {
"blocks": "minecraft:respawn_anchor"
}
}
}
}
- Removed the following actions:
minecraft:open_book_from_item- This is now part of the
minecraft:text_holderitem behaviour component.
- This is now part of the
minecraft:saddle_entity_at_position- This has been replaced by equipment and
minecraft:equip_entity_at_positionshould be used instead.
- This has been replaced by equipment and
minecraft:set_item_pointer_location- This has been moved to an item modifier.
minecraft:attach_leashed_entities_on_block
- Added a new field called
position:- Its value is a position target and determines the position the leashed entities will be attached to.
minecraft:damage_item
- Removed the
ignore_game_modefield.- The action now always takes the game mode into account.
minecraft:drop_item_from_block
- Changed the
itemfield to take an item stack instead of an item.
minecraft:exchange_item
- Changed the
itemfield to take an item stack instead of an item. - Removed the
componentsfield.- The components are now defined in the
itemfield instead.
- The components are now defined in the
So if you had this:
{
"type": "minecraft:exchange_item",
"components": {
"minecraft:potion_contents": {
"potion": "minecraft:water"
}
},
"item": "minecraft:potion"
}
You now have to use this instead:
{
"type": "minecraft:exchange_item",
"item": {
"id": "minecraft:potion",
"components": {
"minecraft:potion_contents": {
"potion": "minecraft:water"
}
},
"count": 1
}
}
minecraft:fertilize
- Added a new field called
position:- Its value is a position target and determines the position to fertilize.
minecraft:modify_item
- Removed the
contextfield.- The item modifier now uses the exact same context as the action.
- Added the
stackfield, which is an item stack target to use a specific item stack from the context.
minecraft:place_block
- Removed the
decrement_countfield.- This should be replaced by a sequence with a
minecraft:decrement_itemaction.
- This should be replaced by a sequence with a
So if you had this:
{
"type": "minecraft:place_block",
"block": "minecraft:fire",
"decrement_count": true,
"position": "interacted"
}
You now have to use this instead:
{
"type": "minecraft:sequence",
"handler": "minecraft:passing",
"entries": [
{
"type": "minecraft:place_block",
"block": "minecraft:fire",
"position": "interacted"
},
{
"type": "minecraft:decrement_item",
"amount": 1
}
]
}
- Added an optional
place_soundfield.- When specified, this sound will be played instead of the normal block place sound.
minecraft:prime_tnt
- Does not prime tnt when the
tntExplodesgame rule is disabled. - Turns any block into primed TNT now instead of just TNT.
- The block that is primed is used for the display.
- Checking for the TNT block must be done in the action requirements now.
So if you had this:
{
"action": {
"type": "minecraft:prime_tnt",
"position": "target"
}
}
You now have to use this instead:
{
"action": {
"type": "minecraft:prime_tnt",
"position": "interacted"
},
"requirements": {
"condition": "minecraft:location_check",
"position": "interacted",
"predicate": {
"block": {
"blocks": "minecraft:tnt"
}
}
}
}
minecraft:run_function
- Moved the
entityandpositionfields up due to the removal of action context parameters.
So if you had this:
{
"type": "minecraft:run_function",
"function": "example:function",
"context": {
"entity": "this",
"position": "this"
}
}
You now have to use this instead:
{
"type": "minecraft:run_function",
"function": "example:function",
"entity": "this",
"position": "origin"
}
- Both fields are optional now and will never try to pass the parameter if not specified.
So if you only want the position context you can use this:
{
"type": "minecraft:run_function",
"function": "example:function",
"position": "origin"
}
minecraft:sequence
- Now no longer incorrectly reports duplicate actions defined in the same sequence as recursive.
minecraft:swing_hand
- Added a new field called
entity:- Its value is an entity target and determines whose hand to swing.
World Modifications
Can modify the world by adding or removing something from it.
minecraft:drain_fluid
- Drains a fluid from the world.
- Has no additional fields.
- Leaves an item stack specified by the drained fluid.
minecraft:place_fluid
- Places a fluid in the world.
- Fields:
fluid: A fluid. The fluid to place.place_sound: A sound event. The sound to play when placed.transforms_into: An item. The item to leave when successfully placed.
- Leaves the item stack specified in the
transforms_intofield.
minecraft:place_block
- Places a block in the world.
- Fields:
block: A block picker. The block to place.place_sound: A sound event. The sound to play when placed.transforms_into: An item. The item to leave when successfully placed.
- Leaves the item stack specified in the
transforms_intofield.
Entity Spawners
- Spawns an entity using the specified rules.
- Fields:
entity: An entity type. The entity type to spawn.- If
allow_item_datais set totrue, the entity type may additionally be determined via theminecraft:entity_datadata component from the used item stack, which takes precedence over theentityfield.
- If
spawn_rules: An optional list of spawn rules. The spawn rules to apply in the specified order.components: An optional set of components. The components to apply to the spawned entity.spawn_sound: An optional sound event. The sound to play when the entity is spawned.allow_item_data: An optional boolean defaulting tofalse. Whether to allow item data from theminecraft:entity_datadata component from the used item stack.
Entity Spawn Rules
- Determines whether to place the entity or not and if so, its position and rotation.
- Rules are applied when the condition passes or when no condition is specified.
- Common fields:
condition: An optional predicate. Determines whether to apply the rule or not.
minecraft:align_yaw
- Aligns the entity's yaw based on the placer's own yaw using the specified amount of steps.
- Fields:
step: An integer ranging from 2 to 360. The amount of steps.- For example, a value of 8 rounds to the nearest 45 degree as
360 / 8 = 45.
- For example, a value of 8 rounds to the nearest 45 degree as
Example:
{
"type": "minecraft:align_yaw",
"steps": 8
}
minecraft:discard
- Discards the entity entirely.
- Has no additional fields.
Example:
{
"type": "minecraft:discard",
"condition": {
"condition": "minecraft:side_check",
"sides": [
"down"
]
}
}
minecraft:fits_in_volume
- Checks whether the specified hitbox or otherwise entity's default hitbox fits in the specified volume.
- The hitbox to check for is centred around the entity spawner's current spawn position.
- Fields:
blocks: An optional boolean. Defaults totrue. Whether to check if the entity fits inside the surrounding blocks.entities: An optional boolean. Defaults totrue. Whether to check if the entity fits inside the surrounding entities.volume: An optional list of three doubles. The volume to use instead of the entity's hitbox.
Example:
{
"type": "minecraft:fits_in_volume",
"blocks": false,
"volume": [
1.0,
2.0,
1.0
]
}
minecraft:offset_spawn_position
- Offsets the entity's spawn position by the specified amount.
- Fields:
offset: A list of three doubles. The position offset.
{
"type": "minecraft:offset_spawn_position",
"offset": [
0.0,
0.0625,
0.0
]
}
Predicates
- Added a
minecraft:villagerentity sub-predicate, which is a temporary solution that will be removed once a component predicate for a Villager's type has been added (alongside data-driven trades as those will be part of vanilla by then)- Fields:
variant, which is a Villager variant, list of Villager variants or hash-prefixed Villager variant tag and the Villager's variant must match in order to pass.
- Fields:
Example:
{
"type": "minecraft:villager",
"variant": [
"minecraft:swamp",
"minecraft:snow",
"minecraft:plains"
]
}
minecraft:location_check
- Added a new optional field called
position:- Its value is a position target and is the position to retrieve to use for the check.
- Its default value is
"origin"to match existing behaviour. - Fails if the position defined is not present in the context.
Example:
{
"condition": "minecraft:location_check",
"position": "interacted",
"predicate": {
"block": {
"blocks": "minecraft:tnt"
}
}
}
Item Modifiers
minecraft:set_item_pointer_location
- Sets the
minecraft:lodestone_trackerdata component to the provided position. - Fields:
position, which is a position target to use as the item pointer location.
Example:
{
"function": "minecraft:set_item_pointer_location",
"position": "interacted"
},
minecraft:split
- Splits the item stack into the original and one with the provided count.
- Fields:
count, which is a number provider to split the item stack into one with the provided new count.
Example:
{
"count": 1.0,
"function": "minecraft:split"
}
Context Parameters
Added the following context parameters from the migration:
minecraft:side, which is the side of a block that was interacted with.- Passed in the
minecraft:bucketitem behaviour. - Passed in the
minecraft:entityitem behaviour. - Used in dispense behaviour to interact with the Dispenser's facing direction.
- Used in the
minecraft:side_checkpredicate. - Used in the
minecraft:drop_item_from_blockaction. - Used in the
minecraft:fertilizeaction. - Used in the
minecraft:use_bucketaction.
- Passed in the
minecraft:interacted_position, which is the position that the user interacted with.- Passed and used in various item behaviour.
- Used in dispense behaviour to interact with the Dispenser's output position.
minecraft:equipment_slot, which is used when an item is broken.minecraft:hand, which is the hand used to execute an action.- Passed to various item events when an item is being used.
- Used in the
minecraft:swing_handaction to swing the hand. - Used in the
minecraft:open_book_from_itemaction to get the book from the executing entity.
minecraft:target_entity, which is the entity that was interacted with.- Used in the
minecraft:entityandminecraft:throwableitem behaviour for the spawned entities. - Passed to the
minecraft:hit_entityandminecraft:use_weaponitem events for the attacked entity. - Passed to the
minecraft:use_on_entityitem event for the interacted entity.
- Used in the
Action context parameters were replaced with new targets to be consistent with vanilla. This means that all parameters are now passed to loot tables, item modifiers and predicates instead of having to select specific ones using action context parameters, which were removed as well. This also means that you may need to update the value of certain fields. All changes are visible below.
Entity Targets
| Old | New | Context Parameter |
|---|---|---|
"this" | "this" | minecraft:this_entity |
"target" | "target_entity" | minecraft:target_entity |
So if you had this:
{
"type": "minecraft:set_entity_name_from_item",
"entity": "target"
}
You now have to use this instead:
{
"type": "minecraft:set_entity_name_from_item",
"entity": "target_entity"
}
Position Targets
| Old | New | Context Parameter |
|---|---|---|
"this" | "origin" | minecraft:origin |
"target" | "interacted" | minecraft:interacted_position |
So if you had this:
{
"type": "minecraft:set_block_state",
"position": "target",
"state": {
"Name": "minecraft:farmland",
"Properties": {
"moisture": "0"
}
}
}
You now have to use this instead:
{
"type": "minecraft:set_block_state",
"position": "interacted",
"state": {
"Name": "minecraft:farmland",
"Properties": {
"moisture": "0"
}
}
}
Item Stack Targets
These are new and point to item stacks to use from the context.
Currently the only available value is tool, which points to the minecraft:tool context parameter.
Trades
- Added an optional
merchant_predicatefield, which is a predicate that must pass in order for the trade to be considered of a merchant's trade set.
Fixes
- The
minecraft:charge_typeproperty now works correctly again on item assets. - Exchanging item stacks now works correctly again by dropping the exchanged item stack instead of the current item stack.
- Fixed the world modification type registry name.
