我的世界DIY药水制作教程,首先看一下如何扔出一个自定义药水—
那么想让命令方块扔出一个喷溅药水,首先要写一个开头——
/summon ThrownPotion ~ ~ ~
复制代码
这将不会产生任何效果,所以我们要添加参数——
/summon ThrownPotion ~ ~ ~ {【药水参数】}
复制代码
【药水参数】就是物品的数据值。我们可用它来生成普通的喷溅药水(创造模式可直接从物品栏拿)。
但是我们想要自定义的药水效果,比如说只能用/give命令得到的那种……
/summon ThrownPotion ~ ~ ~ {Potion:{id:373,Damage:【损害值】,Count:1}}
复制代码
Potion 是药水的另一个标签……
id:373 一直是这样,因为药水就是这个ID……
Damage:【损害值】 药水的样子,颜色……
损害值表:
(点击查看大图)
Count 数量……
/summon ThrownPotion ~ ~ ~ {Potion:{id:373,Damage:,Count:1,tag:{CustomPotionEffects:[{Id:,Amplifier:,Duration:}]}}}
复制代码
来自中文WIKI,下午刚刚花了一些时间翻译更新
药水效果
药水和喷溅药水可以通过tag标签来绕过物品本身的参数,来达到多个自定义的药水效果。这些参数只在以下标签全部存在的情况下才会起作用。
tag: tag标签。
CustomPotionEffects: 此药水所包含的自定义药水效果。
一个效果。
Id: 效果的ID。
Amplifier: 效果的效力,此值为0时则是1级。
Duration: 效果的持续时间,单位为刻。
Ambient: 1 或 0 (是/否) - 是否减少玩家被药水效果影响时在身体周围出现彩色旋转漩涡的粒子效果的透明度,用于区分效果是否来自于信标。此标签可选,而且暂时没有效果。
例子——
/summon ThrownPotion ~ ~ ~ {Potion:{id:373,Damage:16385,Count:1,tag:{CustompotionEffects:[{Id:1,Amplifier:1,Duration:1},{Id:2,Amplifier:2,Duration:2}]}}}
复制代码
分析:{Potion:{}}——NBT实体标签的一个分支(必要)
{id:373,Damage:16385,Count:1,tag:{}}——id:373(药水ID);损害值:16385(由表得知,生命恢复,喷溅);数量:1;tag(标签,自定义药水必要)
{CustompotionEffects:[{},{}]}——CustompotionEffects,必要句柄,[] 方括号表示这是一个列表
{Id:1,Amplifier:1,Duration:1},——id:1(速度),Amplifier:1(等级0),Duration:1(持续长度1刻)
{Id:2,Amplifier:2,Duration:2}——id:2(缓慢),Amplifier:2(等级1),Duration:2(持续长度2刻)
这是另一个使用的例子——
/summon ThrownPotion ~ ~-2 ~ {Potion:{id:373,Damage:16421,Count:1},Riding:{id:Silverfish,Attributes:[{Name:generic.movementSpeed,Base:0.0},{Name:generic.maxHealth,Base:0.1},{Name:generic.attackDamage,Base:0.0},{Name:generic.knockbackResistance,Base:100.0}],ActiveEffects:[{Id:14,Amplifier:1,Duration:640000,Ambient:1}]}}
复制代码
分析:不难看出这是一个药水和生物的组合,药水显示为瞬间治疗双倍药效版喷溅版,数量1,骑在一条蠹虫上面(速度0,最高生命值0.1,攻击伤害0,击退防御100,怪物附带效果为14隐身,持续时间无限),也就是说杀死怪物,药水自动掉落
下面也是一个可拾取强化道具的例子,药水骑在经验球的上面,一旦碰到,经验球被吸收,药水掉落
/summon ThrownPotion ~ ~ ~ {Potion:{id:373,Damage:16385,Count:1,tag:{CustomPotionEffects:[{Amplifier:50,Duration:999999,Id:1}]}},Riding:{id:XPOrb}}
复制代码
下面为玩家冰块⑨号自创教程
同样的,我们可以为扔出药水赋予一个速度——
/summon ThrownPotion ~ ~1 ~ {Potion:{id:373,Damage:16456,Count:1,tag:{CustomPotionEffects:[{Amplifier:3,Id:20,Duration:400}]}},Motion:[0,0.1,0.99]}
复制代码
在Motion中,按照 XYZ 的顺序的参数就是药水的初始速度,注意不要让药水生成在一个有障碍物的环境里,可惜的是XYZ的最高数值被限制在“1”以下,所以也不要指望能扔的很远……
你可以试着把这些命令填进命令矿车里……一个移动的炮台?哈哈?
/summon MinecartCommandBlock ~ ~ ~
{Command:"/summon ThrownPotion ~ ~1 ~ {Potion:{id:373,Damage:16456,Count:1,tag:{CustomPotionEffects:[{Amplifier:3,Id:20,Duration:400}]}},Motion:[0,0.1,0.9]}"}
复制代码
如果你想进行范围攻击……这里也有一段成熟的代码……
/summon MinecartCommandBlock ~ ~ ~
{Riding:{id:"MinecartCommandBlock",
Riding:{id:"MinecartCommandBlock",
Riding:{id:"MinecartCommandBlock",
Riding:{id:"MinecartCommandBlock",
Command:"/summon ThrownPotion ~ ~1 ~ {ownerName:Icy_Kun,Potion:{id:373,Damage:16396,Count:1,tag:{CustomPotionEffects:[{Amplifier:3,Id:7,Duration:400}]}},Motion:[0.9,0.1,-0.9]}"},
Command:"/summon ThrownPotion ~ ~1 ~ {ownerName:Icy_Kun,Potion:{id:373,Damage:16396,Count:1,tag:{CustomPotionEffects:[{Amplifier:3,Id:7,Duration:400}]}},Motion:[0.9,0.1,-0.45]}"},
Command:"/summon ThrownPotion ~ ~1 ~ {ownerName:Icy_Kun,Potion:{id:373,Damage:16396,Count:1,tag:{CustomPotionEffects:[{Amplifier:3,Id:7,Duration:400}]}},Motion:[0.9,0.1,0]}"},
Command:"/summon ThrownPotion ~ ~1 ~ {ownerName:Icy_Kun,Potion:{id:373,Damage:16396,Count:1,tag:{CustomPotionEffects:[{Amplifier:3,Id:7,Duration:400}]}},Motion:[0.9,0.1,0.45]}"},
Command:"/summon ThrownPotion ~ ~1 ~ {ownerName:Icy_Kun,Potion:{id:373,Damage:16396,Count:1,tag:{CustomPotionEffects:[{Amplifier:3,Id:7,Duration:400}]}},Motion:[0.9,0.1,0.9]}"}
复制代码
你可能会发现这里面多了一句“ownerName:Icy_Kun”,这是我的用户名,也表示药水的拥有者,本意是测试用命令方块刷出的药水能否被我所拥有(用于塔防地图的杀僵尸数统计……),注意不要放在“Potion”的列表里面!
记得铺一层激活铁轨……