Minecraft基岩版4D皮膚製作教學 (資源包方法)

上一篇文章: 

資源包除了改皮膚外,還可以自訂玩家模型。利用這篇文章的原理也能夠做出「假3D武器」和修改玩家披風。

本文的範本檔案可以在以上文章下載。

首先先建模,然後:

選擇「整個取代掉」

或是只給玩家模型添加「配件」

但請注意,使用「整個取代掉」的方法,必須把你安裝的皮膚換回預設的史蒂夫,否則不會生效。


如果使用「只添加配件」方法,則你可以繼續使用自己的皮膚,如圖。



將建模匯出的模型放到資源包/resource_packs/models/entity/

材質則是放到/textures/entity/

接下來選擇其中一種方法來達成4D效果。


整個取代掉

這個方法比較簡單,直接修改玩家預設使用的模型。

缺點是無法隨便換skin。適合用於把玩家整個身體都改掉的模型,甚至能讓頭不見。

從原版範本資源包複製/entity/player.json到自己的資源包,進行如下修改:

{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "minecraft:player",
      "materials": {
        "default": "entity_alphatest",
        "cape": "entity_alphatest",
        "animated": "player_animated"
      },
      "textures": {
        "default": "textures/entity/beefist",
        //把玩家材質直接換成模型的
        "cape": "textures/entity/cape_invisible"
      },
      "geometry": {
        "default": "geometry.beefist",
        //修改玩家模型,換成beefist
        "cape": "geometry.cape"
      },
  //(下略)


接著在世界中啟用資源包。


只添加配件

這個方法的原理是利用多重render_controller,達到在同一個實體上顯示多個模型的效果。

就像是市集購買的皮膚配件一樣,可以讓任何皮膚的玩家都穿戴上「配件」。


1. 因為我這個模型只是在玩家手上加二個拳套而已,其實模型部分的史蒂夫根本不需要。所以在Blockbench其他cube全部刪除,只留下bone的資料夾,以及拳套的那二個cube。匯出模型。


2. 然後修改player.json,插入新的material、材質、geometry、render_controller。

{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "minecraft:player",
      "materials": {
        "default": "entity_alphatest",
        "cape": "entity_alphatest",
        "animated": "player_animated",
        "beefist": "entity_alphatest"
        //添加material
      },
      "textures": {
        "default": "textures/entity/steve",
        "cape": "textures/entity/cape_invisible",
        "beefist": "textures/entity/beefist"
        //添加材質
      },
      "geometry": {
        "default": "geometry.humanoid.custom",
        "cape": "geometry.cape",
        "beefist": "geometry.beefist"
        //添加geometry
      },
      "scripts": {
        "scale": "0.9375",
        "initialize": [
          "variable.is_holding_right = 0.0;",
          "variable.is_blinking = 0.0;",
          "variable.last_blink_time = 0.0;",
          "variable.hand_bob = 0.0;"
        ],
        "pre_animation": [
          "variable.helmet_layer_visible = 1.0;",
          "variable.leg_layer_visible = 1.0;",
          "variable.boot_layer_visible = 1.0;",
          "variable.chest_layer_visible = 1.0;",
          "variable.attack_body_rot_y = Math.sin(360*Math.sqrt(variable.attack_time)) * 5.0;",
          "variable.tcos0 = (math.cos(query.modified_distance_moved * 38.17) * query.modified_move_speed / variable.gliding_speed_value) * 57.3;",
          "variable.first_person_rotation_factor = math.sin((1 - variable.attack_time) * 180.0);",
          "variable.hand_bob = query.life_time < 0.01 ? 0.0 : variable.hand_bob + ((query.is_on_ground && query.is_alive ? math.clamp(math.sqrt(math.pow(query.position_delta(0), 2.0) + math.pow(query.position_delta(2), 2.0)), 0.0, 0.1) : 0.0) - variable.hand_bob) * 0.02;",
          "variable.map_angle = math.clamp(1 - variable.player_x_rotation / 45.1, 0.0, 1.0);",
          "variable.item_use_normalized = query.main_hand_item_use_duration / query.main_hand_item_max_duration;"
        ],
        "animate": [
          "root"
        ]
      },
      "animations": {
        "root": "controller.animation.player.root",
        "base_controller": "controller.animation.player.base",
        "hudplayer": "controller.animation.player.hudplayer",
        "humanoid_base_pose": "animation.humanoid.base_pose",
        "look_at_target": "controller.animation.humanoid.look_at_target",
        "look_at_target_ui": "animation.player.look_at_target.ui",
        "look_at_target_default": "animation.humanoid.look_at_target.default",
        "look_at_target_gliding": "animation.humanoid.look_at_target.gliding",
        "look_at_target_swimming": "animation.humanoid.look_at_target.swimming",
        "look_at_target_inverted": "animation.player.look_at_target.inverted",
        "cape": "animation.player.cape",
        "move.arms": "animation.player.move.arms",
        "move.legs": "animation.player.move.legs",
        "swimming": "animation.player.swim",
        "swimming.legs": "animation.player.swim.legs",
        "riding.arms": "animation.player.riding.arms",
        "riding.legs": "animation.player.riding.legs",
        "holding": "animation.player.holding",
        "brandish_spear": "animation.humanoid.brandish_spear",
        "holding_spyglass": "animation.humanoid.holding_spyglass",
        "charging": "animation.humanoid.charging",
        "attack.positions": "animation.player.attack.positions",
        "attack.rotations": "animation.player.attack.rotations",
        "sneaking": "animation.player.sneaking",
        "bob": "animation.player.bob",
        "damage_nearby_mobs": "animation.humanoid.damage_nearby_mobs",
        "bow_and_arrow": "animation.humanoid.bow_and_arrow",
        "use_item_progress": "animation.humanoid.use_item_progress",
        "skeleton_attack": "animation.skeleton.attack",
        "sleeping": "animation.player.sleeping",
        "first_person_base_pose": "animation.player.first_person.base_pose",
        "first_person_empty_hand": "animation.player.first_person.empty_hand",
        "first_person_swap_item": "animation.player.first_person.swap_item",
        "first_person_attack_controller": "controller.animation.player.first_person_attack",
        "first_person_attack_rotation": "animation.player.first_person.attack_rotation",
        "first_person_vr_attack_rotation": "animation.player.first_person.vr_attack_rotation",
        "first_person_walk": "animation.player.first_person.walk",
        "first_person_map_controller": "controller.animation.player.first_person_map",
        "first_person_map_hold": "animation.player.first_person.map_hold",
        "first_person_map_hold_attack": "animation.player.first_person.map_hold_attack",
        "first_person_map_hold_off_hand": "animation.player.first_person.map_hold_off_hand",
        "first_person_map_hold_main_hand": "animation.player.first_person.map_hold_main_hand",
        "first_person_crossbow_equipped": "animation.player.first_person.crossbow_equipped",
        "third_person_crossbow_equipped": "animation.player.crossbow_equipped",
        "third_person_bow_equipped": "animation.player.bow_equipped",
        "crossbow_hold": "animation.player.crossbow_hold",
        "crossbow_controller": "controller.animation.player.crossbow",
        "shield_block_main_hand": "animation.player.shield_block_main_hand",
        "shield_block_off_hand": "animation.player.shield_block_off_hand",
        "blink": "controller.animation.persona.blink"
      },
      //插入新的render controller,這裡設成第三人稱才顯示
      "render_controllers": [
        {
          "controller.render.player.beefist": "!variable.is_first_person && !variable.map_face_icon"
        },
        {
          "controller.render.player.first_person": "variable.is_first_person"
        },
        {
          "controller.render.player.third_person": "!variable.is_first_person && !variable.map_face_icon"
        },
        {
          "controller.render.player.map": "variable.map_face_icon"
        }
      ],
      "enable_attachables": true
    }
  }
}


3. 再在資源包的render_controllers資料夾,新增一個新的render_controller,叫做beefist.json :

{
  "format_version": "1.8.0",
  "render_controllers": {
    "controller.render.player.beefist": {
      "geometry": "Geometry.beefist",
      //entity/player.json所新增的geometry
      "materials": [
        {
          "*": "Material.beefist"
        }
      ],
       //entity/player.json所新增的material
      "textures": [
        "Texture.beefist"
      ]
      //entity/player.json所新增的材質
    }
  }
}


完成。

但是這裡只設定在第三人稱顯示,如果要在其他視角顯示,就請自行複製player的render controller進行細部調整吧!

請參閱NPA這個Add-On了解這方面的問題。改用「全部取代掉」的方法,再把自己的皮膚檔案複製到這個資源包的/textures/entiy/裡面,再重新命名成steve.png即可。


另外,想改披風的話,請下載這個資源包依樣畫葫蘆。

留言

此網誌的熱門文章

Minecraft基岩版多人連線教學: 方法一覽

【詳細解說】什麼是Minecraft基岩版,跟Java版有什麼差?

Minecraft基岩版安裝模組(Add-On)&資源包&光影教學