SigmundGranaas / forgero

Tool creation and customization mod for Minecraft
MIT License
48 stars 15 forks source link

[Feature]: Multiple weapon types #1089

Closed SigmundGranaas closed 2 months ago

SigmundGranaas commented 2 months ago

Adds type support for different weapons. Included are two packages for Clubs and Spears.

Example implementation of a spear head:

{
  "type": "SPEAR_HEAD_SCHEMATIC",
  "name": "spear_head-schematic",
  "parent": "sword_blade_base",
  "resource_type": "DEFAULT",
  "container": {
    "type": "CREATE",
    "id": "this"
  },
  "construct": {
    "type": "SPEAR_HEAD",
    "target": "CREATE",
    "recipes": [
      {
        "crafting_type": "SCHEMATIC_PART_CRAFTING",
        "ingredients": [
          {
            "id": "this"
          },
          {
            "type": "TOOL_MATERIAL",
            "unique": true,
            "amount": 2
          }
        ]
      }
    ],
    "components": [
      {
        "id": "this"
      },
      {
        "type": "TOOL_MATERIAL",
        "unique": true
      }
    ],
    "slots": [
      {
        "upgrade_type": "SMITHING",
        "category": [
          "OFFENSIVE"
        ],
        "description": "reinforcement",
        "type": "UPGRADE_MATERIAL",
        "tier": 1
      },
      {
        "upgrade_type": "SMITHING",
        "category": [
          "UTILITY"
        ],
        "description": "cosmetic",
        "type": "DYE",
        "tier": 1
      }
    ]
  },
  "properties": {
    "grouped_attributes": [
      {
        "context": "COMPOSITE",
        "operation": "MULTIPLICATION",
        "order": "BASE",
        "attributes": [
          {
            "id": "variant-schematic-rarity-composite",
            "type": "RARITY",
            "value": 1.375
          },
          {
            "id": "variant-schematic-attack_damage-composite",
            "type": "ATTACK_DAMAGE",
            "value": 1.65
          },
          {
            "id": "variant-schematic-durability-composite",
            "type": "DURABILITY",
            "value": 1.35
          },
          {
            "id": "variant-schematic-weight-composite",
            "type": "WEIGHT",
            "value": 1.2
          }
        ]
      }
    ],
    "attributes": [
      {
        "id": "schematic-rarity-local",
        "type": "RARITY",
        "order": "BASE",
        "category": "LOCAL",
        "operation": "ADDITION",
        "value": 75
      },
      {
        "id": "variant-reach-composite",
        "type": "forgero:reach",
        "value": 7.5
      },
      {
        "id": "sprinting-attack_damage-composite",
        "type": "ATTACK_DAMAGE",
        "order": "END",
        "operation": "MULTIPLICATION",
        "value": 1.5,
        "predicate": {
          "type": "minecraft:entity",
          "flag": {
            "is_sprinting": true
          }
        }
      }
    ],
    "features": [
      {
        "type": "minecraft:on_use",
        "max_use_time": 72000,
        "use_action": "SPEAR",
        "use": [
          {
            "type": "minecraft:consume"
          }
        ],
        "on_stop": [
          {
            "type": "forgero:throw",
            "velocity_multiplier": 3
          },
          {
            "type": "minecraft:play_sound",
            "sound": "minecraft:item.trident.throw"
          },
          {
            "type": "minecraft:consume_stack",
            "count": 1
          }
        ]
      }
    ]
  },
  "custom_data": {
    "ingredient_count": {
      "value": 2,
      "context": "LOCAL"
    }
  }
}