Skip to content

Instantly share code, notes, and snippets.

@eggohito
Last active July 13, 2024 16:37
Show Gist options
  • Save eggohito/510eb0cf7d36d40f906ac1fcef74ee96 to your computer and use it in GitHub Desktop.
Save eggohito/510eb0cf7d36d40f906ac1fcef74ee96 to your computer and use it in GitHub Desktop.

As you may know, there have been a lot of major changes from 1.20.2, to 1.20.5/6 and 1.21; which resulted in some power/action/condition/data types that cannot be re-implemented. This is due to the work-arounds being either too unreliable/too hacky, too much of a pain to maintain in the long run, or just outright impossible to do, therefore, we've decided to remove and re-structure stuff to accommodate for the changes.

Things that have been removed

  • Any fields/types related to harvest levels (e.g: harvest_level item condition type) since items no longer have a harvest level property.
  • Any fields/types related to entity groups (e.g: entity_group entity condition/power type) since entity groups have been removed in favor of using entity type tags.
  • Reach Entity Attributes have been removed as a dependency since vanilla now provides new attributes related to interaction range:
    • minecraft:player.entity_interaction_range (equivalent to reach-entity-attributes:attack_range)
    • minecraft:player.block_interaction_range (equivalent to reach-entity-attributes:reach)

Things that will likely be removed

  • Any fields/types that uses the block material data type, as block materials have been removed for quite some time (since 1.20.) Block tags can be used for its purpose in powers.
  • Any fields that use the legacy damage source data type since it has been deprecated for quite some time. Usage of damage type and damage type tags to control the properties of a damage source is recommended, which is much more customizable.
  • The meat item condition type since the meat property from an item's food component no longer exists. The usage of the meat property is now controlled via the minecraft:wolf_food item tag (which references the minecraft:meat item tag.)

Things that need to be re-implemented

  • The overlay power type to accommodate for the changes in rendering.
  • The modify_enchantment_level power type to accommodate for data-driven enchantments. (Partially re-implemented.)
  • Item modifier/condition types related to item powers (e.g: add_power, remove_power, power_count, etc.) to accommodate for the re-implementation of item powers from NBT to components.

Things that have been changed

  • The item stack data type now has a components field as a replacement for its tag field, which is an object with key-value pairs that specifies which components will be added/removed (if prefixed with !) to/from the item stack:

From:

"entity_action": {
    "type": "origins:give",
    "stack": {
        "item": "minecraft:egg",
        "tag": "{display: {Name: '{\"text\": \"Big Egg\"}'}, big_egg: true}"
    }
}

To:

"entity_action": {
    "type": "origins:give",
    "stack": {
        "item": "minecraft:egg",
        "components": {
            "minecraft:custom_name": "{\"text\": \"Big Egg\"}",
            "minecraft:custom_data": {
                "big_egg": true
            }
        }
    }
}

  • The attributed attribute modifier data type now has an id field (the field is required!) as a replacement for the name field, which determines the attributed attribute modifier's ID as its "source" (before, the name field is not used at all, as the attributed attribute modifier uses a randomized UUID to determine its "source".)

    Attributed attribute modifier operations have also been renamed from addition, multiply_base, and multiply_total to add_value, add_multiplied_base, add_multiplied_total:

From:

"modifier": {
    "name": "Additional movement speed"
    "attribute": "minecraft:generic.movement_speed",
    "operation": "addition",
    "value": 0.015
}

To:

"modifier": {
    "id": "example:additional_movement_speed"
    "attribute": "minecraft:generic.movement_speed",
    "operation": "add_value",
    "value": 0.015
}

  • The spawn_effect_cloud entity action type now has an effect_component field as a replacement for the effect/effects fields, which specifies the area effect cloud's base potion effect (potion, optional), custom color (custom_color, optional), or bonus status effects (custom_effects, optional.):

From:

"entity_action": {
    "type": "origins:spawn_effect_cloud",
    "radius": 16.0,
    "effects": [
        {
            "effect": "minecraft:slowness",
            "amplifier": 1,
            "duration": 200
        },
        {
            "effect": "minecraft:poison",
            "amplifier": 0,
            "duration": 100
        }
    ]
}

To:

"entity_action": {
    "type": "origins:spawn_effect_cloud",
    "radius": 16.0,
    "effect_component": {
        "custom_effects": [
            {
                "id": "minecraft:slowness",
                "amplifier": 1,
                "duration": 200
            },
            {
                "id": "minecraft:poison",
                "amplifier": 0,
                "duration": 100
            }
        ]
    }
}

  • The merge_nbt item action type has been renamed to merge_custom_data; it also has been changed to merge NBT to the item's custom data NBT (from the minecraft:custom_data component), which is the behavior of the minecraft:set_custom_data item modifier type.
  • The nbt item condition type has been renamed to custom_data; it has also been changed to check for NBTs of the item's custom NBT (from the minecraft:custom_data component.)
  • The fireproof item condition type has been renamed to fire_resistant to match the name of the minecraft:fire_resistant component.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment