MC官方模板的分析Day1

有一天,小Lget到了一个MC的官方模板,准备研究一下
以下是他第一天的研究过程:


真的是,,,英文不好完全不行啊,,,
打开目录,,,全是英文,,类名都感觉看不懂,,,还是先看一下子
打开entities目录,一看名称就知道这个是实体信息的文件夹
打开一个:arrow.json
展示一下代码(都是Java)

{
  "format_version": "1.8.0",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:arrow",
      "is_spawnable": false,
      "is_summonable": true,
      "is_experimental": false
    },
    "component_groups": {
      "minecraft:hard_arrow": {
        "minecraft:projectile": {
          "onHit": {
            "impact_damage": {
              "damage": [
                1,
                5
              ],
              "knockback": true,
              "semirandomdiffdamage": false,
              "destroyonhit": true
            },
            "stick_in_ground": {
              "shake_time": 0.35
            },
            "arrow_effect": {}
          },
          "hitSound": "bow.hit",
          "power": 1.6,
          "gravity": 0.05,
          "uncertaintyBase": 16,
          "uncertaintyMultiplier": 4,
          "anchor": 1,
          "shouldbounce": true,
          "offset": [
            0,
            -0.1,
            0
          ]
        }
      },
      "minecraft:player_arrow": {
        "minecraft:projectile": {
          "onHit": {
            "impact_damage": {
              "damage": 1,
              "knockback": true,
              "semirandomdiffdamage": true,
              "destroyonhit": true,
              "maxcriticaldamage": 10,
              "mincriticaldamage": 9,
              "powermultiplier": 0.97
            },
            "stick_in_ground": {
              "shake_time": 0.35
            },
            "arrow_effect": {}
          },
          "hitSound": "bow.hit",
          "power": 5.0,
          "gravity": 0.05,
          "uncertaintyBase": 1,
          "uncertaintyMultiplier": 0,
          "anchor": 1,
          "shouldbounce": true,
          "offset": [
            0,
            -0.1,
            0
          ]
        }
      },
      "minecraft:pillager_arrow": {
        "minecraft:projectile": {
          "onHit": {
            "impact_damage": {
              "damage": [
                3,
                6
              ],
              "knockback": true,
              "semirandomdiffdamage": false,
              "destroyonhit": true
            },
            "stick_in_ground": {
              "shake_time": 0.35
            },
            "arrow_effect": {}
          },
          "hitSound": "bow.hit",
          "power": 1.6,
          "gravity": 0.05,
          "uncertaintyBase": 16,
          "uncertaintyMultiplier": 4,
          "anchor": 1,
          "shouldbounce": true,
          "offset": [
            0,
            -0.1,
            0
          ]
        }
      }
    },
    "components": {
      "minecraft:collision_box": {
        "width": 0.25,
        "height": 0.25
      },
      "minecraft:projectile": {
        "onHit": {
          "impact_damage": {
            "damage": [
              1,
              4
            ],
            "knockback": true,
            "semirandomdiffdamage": false,
            "destroyonhit": true
          },
          "stick_in_ground": {
            "shake_time": 0.35
          },
          "arrow_effect": {}
        },
        "hitSound": "bow.hit",
        "power": 1.6,
        "gravity": 0.05,
        "uncertaintyBase": 16,
        "uncertaintyMultiplier": 4,
        "anchor": 1,
        "shouldbounce": true,
        "offset": [
          0,
          -0.1,
          0
        ]
      },
      "minecraft:physics": {}
    },
    "events": {
      "minecraft:entity_spawned": {
        "sequence": [
          {
            "filters": {
              "test": "is_difficulty",
              "value": "hard"
            },
            "add": {
              "component_groups": [
                "minecraft:hard_arrow"
              ]
            }
          },
          {
            "filters": {
              "test": "is_family",
              "subject": "other",
              "value": "player"
            },
            "add": {
              "component_groups": [
                "minecraft:player_arrow"
              ]
            }
          },
          {
            "filters": {
              "test": "is_family",
              "subject": "other",
              "value": "pillager"
            },
            "add": {
              "component_groups": [
                "minecraft:pillager_arrow"
              ]
            }
          }
        ]
      }
    }
  }
}

推一推隐形眼镜,开始研究:


 "format_version": "1.8.0",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:arrow",
      "is_spawnable": false,
      "is_summonable": true,
      "is_experimental": false
    },

这一段应该是他的基本属性
"minecraft:entity":应该是他所属文件夹的名称
"description"好说,属性
identifier目测名称啥的
is_spawnable是否可以生殖,肯定不行啦
is_summonable是否可召唤,这是可以的撒
"is_experimental"实验性?应该是属于老版本的东西,已经确定下来的,所以搞成false


"component_groups": {
      "minecraft:hard_arrow": {     有力量的箭?啥意思
        "minecraft:projectile": {	抛射属性
          "onHit": {				如果打到了
            "impact_damage": {		扣血的
              "damage": [
                1,
                5
              ],
              "knockback": true,	应该是指击退
              "semirandomdiffdamage": false, 随机伤害
              "destroyonhit": true				致命一击	
            },
            "stick_in_ground": {
              "shake_time": 0.35		冷却时间
            },
            "arrow_effect": {}			附魔属性
          },
          "hitSound": "bow.hit",		声音的都
          "power": 1.6,					声音啥的都不说了哈
          "gravity": 0.05,			
          "uncertaintyBase": 16,
          "uncertaintyMultiplier": 4,
          "anchor": 1,
          "shouldbounce": true,
          "offset": [
            0,
            -0.1,
            0
          ]
        }
      },


"minecraft:player_arrow": {					玩家的箭?那说明前面的是小白的箭吗?
        "minecraft:projectile": {			这不解释
          "onHit": {						这下面都说过
            "impact_damage": {
              "damage": 1,
              "knockback": true,
              "semirandomdiffdamage": true,
              "destroyonhit": true,
              "maxcriticaldamage": 10,		最大伤害
              "mincriticaldamage": 9,		最小伤害
              "powermultiplier": 0.97		力量乘数?
            },
            "stick_in_ground": {			射在地上
              "shake_time": 0.35		说过了
            },
            "arrow_effect": {}
          },
          "hitSound": "bow.hit",
          "power": 5.0,
          "gravity": 0.05,
          "uncertaintyBase": 1,
          "uncertaintyMultiplier": 0,
          "anchor": 1,
          "shouldbounce": true,
          "offset": [
            0,
            -0.1,
            0
          ]
        }
      },
      "minecraft:pillager_arrow": {		流浪者的箭
        "minecraft:projectile": {
          "onHit": {
            "impact_damage": {
              "damage": [
                3,					伤害真小,,
                6
              ],
              "knockback": true,
              "semirandomdiffdamage": false,
              "destroyonhit": true
            },
            "stick_in_ground": {
              "shake_time": 0.35
            },
            "arrow_effect": {}
          },
          "hitSound": "bow.hit",
          "power": 1.6,
          "gravity": 0.05,
          "uncertaintyBase": 16,
          "uncertaintyMultiplier": 4,
          "anchor": 1,
          "shouldbounce": true,
          "offset": [
            0,
            -0.1,
            0
          ]
        }
      }
    },
    "components": {
      "minecraft:collision_box": {	发射器的
        "width": 0.25,
        "height": 0.25				图标
      },
      "minecraft:projectile": {
        "onHit": {
          "impact_damage": {
            "damage": [
              1,			伤害也很小
              4	
            ],
            "knockback": true,
            "semirandomdiffdamage": false,	不过这个是flase?
            "destroyonhit": true
          },
          "stick_in_ground": {
            "shake_time": 0.35
          },
          "arrow_effect": {}
        },
        "hitSound": "bow.hit",
        "power": 1.6,
        "gravity": 0.05,
        "uncertaintyBase": 16,
        "uncertaintyMultiplier": 4,	
        "anchor": 1,
        "shouldbounce": true,
        "offset": [
          0,
          -0.1,
          0
        ]
      },
      "minecraft:physics": {}	物理?
    },
    "events": {
      "minecraft:entity_spawned": {	末地小白
        "sequence": [  条件
          {
            "filters": {
              "test": "is_difficulty",
              "value": "hard"
            },
            "add": {
              "component_groups": [
                "minecraft:hard_arrow"
              ]
            }
          },
          {
            "filters": {
              "test": "is_family",
              "subject": "other",
              "value": "player"
            },
            "add": {
              "component_groups": [
                "minecraft:player_arrow"
              ]
            }
          },
          {
            "filters": {
              "test": "is_family",
              "subject": "other",
              "value": "pillager"
            },
            "add": {
              "component_groups": [
                "minecraft:pillager_arrow"
              ]上面的都很简单哈
            }
          }
        ]
      }
    }
  }
}


分析完毕!

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值