Addon Ajouter un effet à un item moddé

Deltaga7

Aventurier
2 Avril 2020
2
0
1
26
Bonjour, je suis actuellement en apprentissage dans les addons de Minecraft bedrock.
j'ai créé un speedstick et je voudrais lui assigné une vitesse lorsque le joueur le tien en main.
Je sais qu'il faut aller dans le fichier player.json et ajouter certain component mais je ne comprend pas tout.
Es-ce que quelqu'un pourrait m'éclairer sur le sujet.
PS: l'item speedstick apparait belle et bien dans le monde

JSON:
{
  "format_version": "1.14.0",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:player",
      "is_spawnable": false,
      "is_summonable": false,
      "is_experimental": false
    },
    
    "component_groups": {
      "delta:example_nothing_held": {
        "minecraft:collision_box": {
          "width": 0.6,
          "height": 1.8
        },
        "minecraft:health": {
          "value": 20,
          "max": 20
        },
        "minecraft:movement": {
          "value": 0.1
        },
        "minecraft:attack": {
          "damage": 1
        },
        "minecraft:spell_effects": {
          "remove_effects": [
            "invisibility",
            "jump_boost",
            "slow_falling"
          ]
        }
      },
      "delta:sword":  {
        "minecraft:attack": {
            "damage": 10
          }   
      },
      "delta:speedstick": {
        "minecraft:movement": {
          "value": 0.2
        }
      }
    },

    "components": {
      "minecraft:type_family": {
        "family": [ "player" ]
      },
      "minecraft:is_hidden_when_invisible": {
      },
      "minecraft:loot": {
        "table": "loot_tables/empty.json"
      },
      "minecraft:collision_box": {
        "width": 0.6,
        "height": 1.8
      },
      "minecraft:can_climb": {
      },
      "minecraft:movement": {
        "value": 0.1
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "filters": { "test": "in_lava", "subject": "self", "operator": "==", "value": true },
            "cause": "lava",
            "damage_per_tick": 4
          }
        ]
      },
      "minecraft:attack": {
        "damage": 1
      },
      "minecraft:player.saturation": {
        "value": 20
      },
      "minecraft:player.exhaustion": {
        "value": 0,
        "max": 4
      },
      "minecraft:player.level": {
        "value": 0,
        "max": 24791
      },
      "minecraft:player.experience": {
        "value": 0,
        "max": 1
      },
      "minecraft:breathable": {
        "total_supply": 15,
        "suffocate_time": -1,
        "inhale_time": 3.75,
        "generates_bubbles": false
      },
      "minecraft:nameable": {
        "always_show": true,
        "allow_name_tag_renaming": false
      },
      "minecraft:physics": {
      },
      "minecraft:pushable": {
        "is_pushable": false,
        "is_pushable_by_piston": true
      },
      "minecraft:insomnia": {
        "days_until_insomnia": 3
      },
      "minecraft:rideable": {
        "seat_count": 2,
        "family_types": [
          "parrot_tame"
        ],
        "pull_in_entities": true,
        "seats": [
          {
            "position": [ 0.4, -0.15, 0.04 ],
            "min_rider_count": 0,
            "max_rider_count": 0,
            "lock_rider_rotation": 0
          },
          {
            "position": [ -0.4, -0.15, 0.04 ],
            "min_rider_count": 1,
            "max_rider_count": 2,
            "lock_rider_rotation": 0
          }
        ]
      },
      "minecraft:scaffolding_climber": {},
      "minecraft:environment_sensor": [
        {
          "on_environment": {
                        "filters": {
                            "any_of": [
                                {
                                    "test": "is_family",
                                    "subject": "self",
                                    "value": "player"
                                }
                            ]
                        },
                        "event": "delta:refresh_player"
                    }
        },
        {
          "on_environment": {
            "filters": {
              "all_of": [
                {
                  "test": "has_equipment",
                  "subject": "self",
                  "domain": "hand",
                  "value": "delta:speedstick"
                }
              ]
            },
            "event": "delta:wielding_speedstick"
          }
        }
          ]
    },

    "events": {
      "delta:refresh_player": {
                "add": {
                    "component_groups": [
                        "delta:example_nothing_held"
                    ]
                },
        "remove": {
          "component_groups": [
            "delta:speedstick"

          ]
        }
      },
      "delta:wielding_speedstick": {
        "add": {
          "component_groups": [
            "delta:speedstick"
          ]
        },
        "remove": {}
      }
    }
  }
}