SigmundGranaas / forgero

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

[Feature]: Predicate for checking if a player is using an item #1109

Closed SigmundGranaas closed 2 months ago

SigmundGranaas commented 2 months ago

Closes #

Usage example:

Pickaxe head schematic:

features": [
      {
        "type": "minecraft:on_use",
        "max_use_time": 72000,
        "use_action": "SPEAR",
        "use": [
          {
            "type": "minecraft:consume"
          }
        ],
        "on_stop": [
          {
            "type": "forgero:throw"
          },
          {
            "type": "minecraft:play_sound",
            "sound": "minecraft:item.trident.throw"
          }
        ]
      }
    ]

Pickaxe head model

 {
      "name": "pickaxe_head",
      "template": "pickaxe_head.png",
      "type": "GENERATE",
      "palette": "TOOL_MATERIAL",
      "order": 20,
      "variants": [
        {
          "target":[
            {
              "type": "minecraft:entity",
              "flag": {
                "is_using": true
              }
            }
          ],
          "display_overrides": {
            "thirdperson_righthand": {
              "rotation": [ 0, 90, -135],
              "translation": [ 0, -4, 2 ],
              "scale": [ 1, 1, 1 ]
            },
            "thirdperson_lefthand": {
              "rotation": [ 0, 90, -135],
              "translation": [ 0, -4, 2 ],
              "scale": [ 1, 1, 1 ]
            },
            "firstperson_righthand": {
              "rotation": [ 0, 90, -135],
              "translation": [ 0, -4, 2 ],
              "scale": [ 1, 1, 1 ]
            },
            "firstperson_lefthand": {
              "rotation": [ 0, 90, -135],
              "translation": [ 0, -4, 2 ],
              "scale": [ 1, 1, 1 ]
            }
          }
        }
      ]

Result image