今回は馬やラバ以外の動物にも乗れるようにしてみたいと思います (操作することはできません.乗ることのみです)
完成動画
はじめに
まずplayerが乗ることのできる馬を見てみます
[house.json]
"minecraft:horse_wild": { "minecraft:rideable": { "seat_count": 1, "family_types": [ "player", "zombie" ], "interact_text": "action.interact.mount", "seats": { "position": [ 0.0, 1.1, -0.2 ] } }, "minecraft:behavior.mount_pathing": { "priority": 2, "speed_multiplier": 1.5, "target_dist": 0.0, "track_target": true }, "minecraft:tamemount": { "min_temper": 0, "max_temper": 100, "feed_text": "action.interact.feed", "ride_text": "action.interact.mount", "feed_items": [ { "item": "wheat", "temper_mod": 3 }, { "item": "sugar", "temper_mod": 3 }, { "item": "apple", "temper_mod": 3 }, { "item": "golden_carrot", "temper_mod": 5 }, { "item": "golden_apple", "temper_mod": 10 }, { "item": "appleEnchanted", "temper_mod": 10 } ], "auto_reject_items": [ { "item": "horsearmorleather" }, { "item": "horsearmoriron" }, { "item": "horsearmorgold" }, { "item": "horsearmordiamond" }, { "item": "saddle" } ], "tame_event": { "event": "minecraft:on_tame", "target": "self" } } }, "minecraft:horse_tamed": { "minecraft:is_tamed": {}, "minecraft:rideable": { "priority": 0, "seat_count": 1, "crouching_skip_interact": true, "family_types": [ "player" ], "interact_text": "action.interact.ride.horse", "seats": { "position": [ 0.0, 1.1, -0.2 ] } }, "minecraft:inventory": { "inventory_size": 2, "container_type": "horse" }, "minecraft:breedable": { "require_tame": true, "inherit_tamed": false, "breeds_with": [ { "mate_type": "minecraft:horse", "baby_type": "minecraft:horse", "breed_event": { "event": "minecraft:entity_born", "target": "baby" } }, { "mate_type": "minecraft:donkey", "baby_type": "minecraft:mule", "breed_event": { "event": "minecraft:entity_born", "target": "baby" } } ], "breed_items": [ "golden_carrot", "golden_apple", "appleEnchanted" ] }, "minecraft:behavior.tempt": { "priority": 5, "speed_multiplier": 1.2, "items": [ "apple", "carrot", "golden_apple", "appleEnchanted", "golden_carrot", "hay_block", "sugar", "bread", "wheat" ] } },
ここで,いまについては二つの状態が設定されていることがわかります
- house_wild:野生の状態でなついていない
- house_tamed:餌などをあげてなつかせた状態
ここで,馬と同じように乗れるように書き換えてみます
コードの書き換え
以下のコードに書き換えてみます. これで,playerが乗ることができました.
"minecraft:rideable": { "seat_count": 1, "family_types": [ "player" ], "interact_text": "action.interact.ride.horse", "seats": { "position": [ 0.0, 1.105, 0.0 ] } },
ワールドの配布
このワールドでは,以下のモブに乗ることができるようになっています. * ネコ * パンダ * オセロット * おおかみ * 牛 * 羊 * マッシュルーム