欢迎光临散文网 会员登陆 & 注册

我的世界指令参数hasitem

2023-01-07 13:28 作者:小皮果吖  | 我要投稿
{"ops":[{"insert":"小皮果吖制作严禁搬运转载!\n作者我的世界版本:网易手机版\n——\nhasitem:一种检测物品的选择器\n常用格式:<选择器>[hasitem={item=自填}]\n☆<选择器>则为@e@a@p@s@r\n它一共有五个参数:\n①item物品(必填)\n②data数据值,默认0\n(选填,目前只对药水有用)\n③quantity数量(选填)\n④location位置(选填)\n⑤slot位置范围(选填)\n同时具有检测多物品功能。\n\n但<选择器>[hasitem={item=自填,item=自填}]是错误写法!这是错误写法!!\n正确写法:<选择器>[hasitem=[{item=自填},{item=自填}]]\n目标选择器需要同时具有指定的俩个物品才能执行指令。\n\n☆参数item\n大家都很熟悉了,在<选择器>[type=item]中是掉落物的意思。\n在hasitem中是必填项,后接物品英文ID。\n比如<选择器>[hasitem={item=diamond}]检测目标选择器是否有钻石,无论是手持还是快捷栏亦或是背包,只要有就会执行指令。\n\n☆参数data数据值,默认为0,后接阿拉伯数字,整数,如0、1、2、3..,也可接1..3、1..这样的。\n<选择器>[hasitem={item=concrete,data=3}]指淡蓝色混凝土\n\n☆quantity数量\n表示物品数量,后接阿拉伯数字,跟data接法差不多。\n<选择器>[hasitem={item=diamond,quantity=1}]\n检测目标选择器有一个钻石就执行指令。\n\n☆location和slot,意思都为位置\n只需记住有slot必有location!\nslot不能单独使用!\n因为slot指在快捷栏、背包、箱子……这些中第几格的位置,后接阿拉伯数字,如0、1、2、3..\n而location用法参考在replaceitem中的位置,其可接以下物品栏名称位置:\nslot.armor 马铠\nslot.armor.chest 胸甲\nslot.armor.feet 靴子\nslot.armor.head 头盔\nslot.armor.legs 腿甲\nslot.chest 箱子\nslot. enderchest 末影箱\nslot.hotbar 快捷栏\nslot.inventory 物品栏\nslot.saddle 鞍\nslot. weapon.mainhand 主手持有slot.weapon.offhand 副手持有\n例子:\n<选择器>[hasitem={item=diamond,location=slot.hotbar}]检测目标选择器快捷栏有钻石就执行指令。\n——\n<选择器>[hasitem={item=diamond,location=slot.hotbar,slot=0}]检测目标选择器快捷栏第一格有钻石就执行指令。\n\n举例参考:\n\n/title @a[hasitem={item=command_block}] actionbar §l§a你有命令方块\n\n/title @a[hasitem={item=command_block,quantity=1}] actionbar §l§a你有一个命令方块\n\n/title @a[hasitem={item=command_block,quantity=2}] actionbar §l§a你有两个命令方块\n\n/title @a[hasitem={item=command_block,quantity=2,location=slot.hotbar,slot=0}] actionbar §l§a你快捷栏第一格有两个命令方块\n\n/title @a[hasitem=[{item=diamond},{item=diamond_block}]] actionbar §l§a你有钻石和钻块\n\n/title @a[hasitem=[{item=diamond,quantity=1},{item=diamond_block}]] actionbar §l§a你有一个钻石和钻块\n\n——完\n"}]}

我的世界指令参数hasitem的评论 (共 条)

分享到微博请遵守国家法律