【问题标题】:Expecting 'EOF', '}', ',', ']', got ':'期待'EOF','}',',',']',得到':'
【发布时间】:2021-09-17 08:47:48
【问题描述】:
{
    "type": "origins:damage_over_time",
    "interval": 40,
    "onset_delay": 1,
    "damage": 1,
    "damage_easy": 1,
    "source": {
        "name": "generic",
        "unblockable": true,
        "bypasses_armor": false
    },
    "condition": {
        "type": "origins:biome",
        "condition": {
            "type": "origins:temperature",
            "comparison": "<=",
            "compare_to": 0.5
        },
        "entity_condition": {
            "type": "origins:in_tag",
            "inverted": true,
            "equipment_slot": "mainhand",
            "item_condition": {
                "type": "origins:in_tag",
                "conditions": [{
                        "type": "minecraft:torch"
                    },
                    "type": "minecraft:lava_bucket",
                }
                "condition": {
                    "type": "origins:block_in_radius",
                    "inverted": true,
                    "block_condition": {
                        "type": "origins:in_tag",
                        "tag": "origins:lava"
                    },
                    "radius": 4,
                    "shape": "cube",
                    "comparison": ">=",
                    "compare_to": 1
                }
            ]
        }
    }
},
"name": "Cold Blooded",
"description": "you can't generate heat, so you die slowly without a source of heat."
}

我一直在尝试在 Minecraft 中创建一个起源,就像在 mod 中一样,但是我的部分代码有问题,我把它放在 JSON Validator 中,它说上面的错误,问题在 "type: "minecraft:lava_bucket" 中,有人可以帮帮我吗?哦,每个人都可以根据需要获得代码,是在寒冷的生物群系中受到伤害,除非您携带火炬或熔岩桶

【问题讨论】:

  • conditions 数组中有格式错误。

标签: json minecraft minecraft-fabric


【解决方案1】:

你的 conditions 数组有这个:

"conditions":
[
  {
    "type": "minecraft:torch"
  },
  "type": "minecraft:lava_bucket",      MISSING OPENING BRACE
  }                                     MISSING COMMA
  "condition":                          DO YOU REALLY WANT THIS HERE?
  {
    "type": "origins:block_in_radius",
    "inverted": true,
    "block_condition":
    {
      "type": "origins:in_tag",
      "tag": "origins:lava"
    },
    "radius": 4,
    "shape": "cube",
    "comparison": ">=",
    "compare_to": 1
  }
]

假设该数组有 3 个对象,您可能希望将其更改为:

"conditions":
[
  {
    "type": "minecraft:torch"
  },
  {
    "type": "minecraft:lava_bucket",
  },
  {
    "type": "origins:block_in_radius",
    "inverted": true,
    "block_condition":
    {
      "type": "origins:in_tag",
      "tag": "origins:lava"
    },
    "radius": 4,
    "shape": "cube",
    "comparison": ">=",
    "compare_to": 1
  }
]

通过我建议的更正,您现在似乎有一个具有三个条件的数组:1) 火炬、2) 熔岩桶和 3) 半径内的熔岩。因此,如果这不是您想要的。你肯定在其他地方也有问题。

【讨论】:

  • 我遵循了代码(好吧,我复制粘贴了),在寒冷的生物群系中我确实受到了伤害,但是当我拿着熔岩桶或火炬时它不会停止,即使当我我在熔岩附近
  • 我不知道你到底想要什么,所以我做了一些假设。如果您查看我放置 BOLD cmets 的 3 行,您可以看到 JSON 出现错误的位置。如果您发布基于您的原始 JSON,也许我可以看到需要更改的内容。
  • 好吧,我打算这样无论你的主手有火把或熔岩桶,还是靠近熔岩,你都不会受到寒冷生物群系的伤害,我实际上是从另一个人那里复制的并尝试进行一些修复,但当我拿着水桶、火炬或靠近熔岩时,我无法停止伤害
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-08-13
  • 1970-01-01
相关资源
最近更新 更多