会员登录 立即注册

搜索

墨山神奇药水

[复制链接]
崎山小鹿 发表于 12 小时前 | 显示全部楼层 |阅读模式
崎山小鹿
12 小时前 70 2 看全部
新建-》配置-》实体-》药水
微信截图_20250617142401.png
使用时间:32
添加动画:drink

{
    "format_version": "1.10",
    "minecraft:item": {
        "components": {
            "minecraft:food": {
                "can_always_eat": true,
                "cooldown_time": 32,
                "effects": [
                    {
                        "amplifier": 3,
                        "chance": 1.0,
                        "duration": 60,
                        "name": "night_vision"
                    }
                ],
                "nutrition": 0,
                "saturation_modifier": "poor",
                "using_converts_to": "minecraft:glass_bottle"
            },
            "minecraft:use_duration": 32.0
        },
        "description": {
            "identifier": "nvykb:feigong"
        }
    }
}


右键使用物品 → 生成一个被投掷的实体(entity) → 自动播放丢掷动画 → 命中后爆炸释放药效
天不生墨翟,万古如长夜!以墨运商,以商助墨。金双石科技长期招聘科技研发人才!微信:qishanxiaolu   电话:15876572365   公司:深圳市金双石科技有限公司
回复

使用道具 举报

 楼主| 崎山小鹿 发表于 12 小时前 | 显示全部楼层
崎山小鹿
12 小时前 看全部
{
    "format_version": "1.10.0",
    "minecraft:client_entity": {
        "description": {
            "animations": {
                "flying": "animation.actor.billboard"
            },
            "geometry": {
                "default": "geometry.item_sprite"
            },
            "identifier": "moshan:feigong",
            "materials": {
                "default": "splash_potion_enchanted"
            },
            "render_controllers": [
                "controller.render.splash_potion"
            ],
            "scripts": {
                "animate": [
                    "flying"
                ]
            },
            "textures": {
                "absorption": "textures/items/potion_bottle_splash_absorption",
                "blindness": "textures/items/potion_bottle_splash_blindness",
                "confusion": "textures/items/potion_bottle_splash_confusion",
                "damageBoost": "textures/items/potion_bottle_splash_damageBoost",
                "default": "textures/items/potion_bottle_splash",
                "digSlowdown": "textures/items/potion_bottle_splash_digSlowdown",
                "digSpeed": "textures/items/potion_bottle_splash_digSpeed",
                "enchanted": "textures/misc/enchanted_item_glint",
                "fireResistance": "textures/items/potion_bottle_splash_fireResistance",
                "harm": "textures/items/potion_bottle_splash_harm",
                "heal": "textures/items/potion_bottle_splash_heal",
                "healthBoost": "textures/items/potion_bottle_splash_healthBoost",
                "hunger": "textures/items/potion_bottle_splash_hunger",
                "invisibility": "textures/items/potion_bottle_splash_invisibility",
                "jump": "textures/items/potion_bottle_splash_jump",
                "levitation": "textures/items/potion_bottle_splash_levitation",
                "moveSlowdown": "textures/items/potion_bottle_splash_moveSlowdown",
                "moveSpeed": "textures/items/potion_bottle_splash_moveSpeed",
                "nightVision": "textures/items/potion_bottle_splash_nightVision",
                "poison": "textures/items/potion_bottle_splash_poison",
                "regeneration": "textures/items/potion_bottle_splash_regeneration",
                "resistance": "textures/items/potion_bottle_splash_resistance",
                "saturation": "textures/items/potion_bottle_splash_saturation",
                "slowFall": "textures/items/potion_bottle_splash_slowFall",
                "turtleMaster": "textures/items/potion_bottle_splash_turtleMaster",
                "waterBreathing": "textures/items/potion_bottle_splash_waterBreathing",
                "weakness": "textures/items/potion_bottle_splash_weakness",
                "wither": "textures/items/potion_bottle_splash_wither"
            }
        }
    }
}
解释:
几何体设置为 item_sprite,这是 Minecraft 中用于显示物品样式的一个内置平面几何体

splash_potion_enchanted 材质,通常表示一种闪烁的魔法药水材质

"scripts": { "animate": ["flying"] }
定义这个实体一开始就自动播放 "flying" 动画(也就是永远面向玩家的效果),不依赖状态机。
天不生墨翟,万古如长夜!以墨运商,以商助墨。金双石科技长期招聘科技研发人才!微信:qishanxiaolu   电话:15876572365   公司:深圳市金双石科技有限公司
回复

使用道具 举报

 楼主| 崎山小鹿 发表于 12 小时前 | 显示全部楼层
崎山小鹿
12 小时前 看全部
{
    "format_version": "1.12.0",
    "minecraft:entity": {
        "component_groups": {

        },
        "components": {
            "minecraft:collision_box": {
                "height": 0.25,
                "width": 0.25
            },
            "minecraft:conditional_bandwidth_optimization": {
                "default_values": {
                    "max_dropped_ticks": 5,
                    "max_optimized_distance": 80.0,
                    "use_motion_prediction_hints": true
                }
            },
            "minecraft:persistent": {

            },
            "minecraft:physics": {

            },
            "minecraft:projectile": {
                "angle_offset": -20.0,
                "gravity": 0.05,
                "hit_sound": "glass",
                "on_hit": {
                    "douse_fire": {

                    },
                    "remove_on_hit": {

                    },
                    "thrown_potion_effect": {

                    }
                },
                "power": 0.5
            },
            "minecraft:pushable": {
                "is_pushable": true,
                "is_pushable_by_piston": true
            }
        },
        "description": {
            "identifier": "moshan:feigong",
            "is_experimental": false,
            "is_spawnable": false,
            "is_summonable": true
        },
        "events": {

        }
    }
}

解释:
"is_spawnable"        是否能自然生成或使用刷怪蛋生成;此处为 false

"components"
这是实体的主要行为配置部分

collision_box 碰撞体积1/4体积大小
conditional_bandwidth_optimization 远距离同步策略
physics 启用基本物理系统

projectile 定义了该实体是一个投掷物类型实体

events: 目前为空。你可以在这里定义命中后触发事件,如变身、召唤新实体、爆炸等

我们增加一个变身的效果,将药水的施加对象变成一只鸡:
{
    "format_version": "1.12.0",
    "minecraft:entity": {
        "component_groups": {

        },
        "components": {
            "minecraft:collision_box": {
                "height": 0.25,
                "width": 0.25
            },
            "minecraft:conditional_bandwidth_optimization": {
                "default_values": {
                    "max_dropped_ticks": 5,
                    "max_optimized_distance": 80.0,
                    "use_motion_prediction_hints": true
                }
            },
            "minecraft:persistent": {

            },
            "minecraft:physics": {

            },
            "minecraft:projectile": {
                "angle_offset": -20.0,
                "gravity": 0.05,
                "hit_sound": "glass",
                "on_hit": {
                    "douse_fire": {

                    },
                    "remove_on_hit": {

                    },
                    "thrown_potion_effect": {

                    },
                    "run_event": {
                        "event": "transform_target"
                    }
                },
                "power": 0.5
            },
            "minecraft:pushable": {
                "is_pushable": true,
                "is_pushable_by_piston": true
            }
        },
        "description": {
            "identifier": "moshan:feigong",
            "is_experimental": false,
            "is_spawnable": false,
            "is_summonable": true
        },
        "events": {
            "transform_target": {
                "run_command": {
                    "command": [
                        "execute @e[type=ravager,distance=..3] ~~~ summon minecraft:chicken",
                        "execute @e[type=ravager,distance=..3] ~~~ kill @s"
                    ]
                }
            }
        }
    }
}

网易版command无法执行
天不生墨翟,万古如长夜!以墨运商,以商助墨。金双石科技长期招聘科技研发人才!微信:qishanxiaolu   电话:15876572365   公司:深圳市金双石科技有限公司
回复

使用道具 举报

  • 您可能感兴趣
您需要登录后才可以回帖 登录 | 立即注册 |

本版积分规则 返回列表

管理员给TA私信
以墨运商,以商助墨。

查看:70 | 回复:2

金双石科技,软件开发20年,技术行业领先,您的满意,就是我们的目标,认真负责,开拓进取,让成品物超所值
关于我们
公司简介
发展历程
联系我们
本站站务
友情链接
新手指南
内容审核
商家合作
广告合作
商家入驻
新闻合作

手机APP

官方微博

官方微信

联系电话:15876572365 地址:深圳市宝安区西乡街道宝民二路宝民花园 ( 粤ICP备2021100124号-1 ) 邮箱:qishanxiaolu@qq.com
QQ|Powered by Discuz! X3.5 © 2001-2025 Discuz! Team.
快速回复 返回顶部 返回列表