• 0

    posted a message on Turret mod for 1.9 experimental scripting - stationary mob

    Hi


    I'm starting out attempting to create a turret addon for 1.9 using the new scripting. So far I just have the resource and behaviour mostly working but I have an issue with the turret moving towards the monster mob when they come within range.


    I started with a shulker, the code looks like;


    {
      "format_version": "1.8.0",
      "minecraft:entity": {
        "description": {
          "identifier": "automatedturret:basicturret",
          "is_spawnable": true,
          "is_summonable": true,
          "is_experimental": true
        },
        "components": {
          "minecraft:type_family": {
            "family": [ "player" ]
          },
          "minecraft:breathable": {
            "totalSupply": 15,
            "suffocateTime": 0
          },
          "minecraft:nameable": {
          },
          "minecraft:health": {
            "value": 500,
            "max": 500
          },
          "minecraft:movement": {
            "value": {
              "range_min": 0,
              "range_max": 0
            }
          },
          "minecraft:shooter": {
            "type": "Arrow",
            "def": "minecraft:arrow"
          },
          "minecraft:behavior.random_look_around": {
            "priority": 8
          },
          "minecraft:behavior.ranged_attack": {
            "attack_interval_min": 1,
            "attack_interval_max": 1,
            "attack_radius": 30
          },
          "minecraft:behavior.hurt_by_target": {
            "priority": 2
          },
          "minecraft:behavior.nearest_attackable_target": {
            "priority": 3,
            "entity_types": {
              "filters": {
                "test": "is_family",
                "subject": "other",
                "value": "monster"
              },
              "max_dist": 32
            },
            "must_see": true
          },
          "minecraft:navigation.walk": {
          },
          "minecraft:movement.basic": {
          }
        }
      }
    }
    

    I thought the movement component being set to zero would do it, but there seems to be a part of "nearest_attackable_target" which suggests it detects and moves towards...


    Can anyone suggest whats needed to stop the turret from moving around?


    Cheers

    Posted in: Add-ons
  • To post a comment, please .