UID683950性别保密经验 EP铁粒 粒回帖0主题精华在线时间 小时注册时间2022-10-30最后登录1970-1-1
|
发表于 2023-3-25 21:51:14 来自手机|显示全部楼层 IP:山西省 本帖最后由 指令凋灵 于 2023-3-25 21:53 编辑
凋零•指令之剑ui:
import{system,MinecraftEffectTypes,MinecraftItemTypes,ItemStack,Location,world,Vector,DynamicPropertiesDefinition,Direction,BlockProperties,Color,Dimension,Effect}from'@minecraft/server';
import { ActionFormData,
ActionFormResponse,
ModalFormData,
ModalFormResponse} from "@minecraft/server-ui";
var cwmode=0,
cwclear=0,
Skill=[],
cwdamage=0,
cwremove=0;
world.events.beforeItemUse.subscribe(
(cwui)=>{
if(cwui.item.typeId=='cw:command_wither_sword'){
if(cwui.source.isSneaking==false){
overworld.runCommandAsync('tag @e [type=!player,type=!item,type=!xp_orb] add cwremove')}
else if(cwui.source.isSneaking==true){
ActionFormDataui(cwui.source)}}});function ActionFormDataui(player){
var cwui=new ActionFormData()
cwui = cwui.title("设置")
.body("设置")
.button("生存")
.button("创造")
.button("防缴/禁生成")
.button("普通/灭世 模式")
.button("反伤 开/关")
.button("反tp")
.button("az")
cwui.show(player).then((cwui)=>{
if(cwui.selection==0){
player.runCommandAsync('gamemode s @s')}
else if(cwui.selection==1){
player.runCommandAsync('gamemode c @s')}
else if(cwui.selection==2){
var cwui=new ModalFormData();
cwui=cwui.title("设置")
.dropdown("选择",["防缴","禁生成"])
.toggle("关/开")
.textField('禁生成名单(目前不可用)','编辑',''+Skill+'')
cwui.show(player).then((cwui)=>{
if(cwui.formValues[0]==0){
if(cwui.formValues[1]==false){
cwclear=0;
overworld.runCommandAsync('say 防缴已关闭');
player.runCommandAsync('tag @s remove sd')}
else if(cwui.formValues[1]==true){
cwclear=1;
overworld.runCommandAsync('say 防缴已开启');
player.runCommandAsync('tag @s add sd')}}
else if(cwui.formValues[0]==1){
if(cwui.formValues[1]==true){
cwremove=1;
overworld.runCommandAsync('say 禁生成已开启')}
else if(cwui.formValues[1]==false){
cwremove=0;
overworld.runCommandAsync('say 禁生成已关闭')}}})}
else if(cwui.selection==3){
if(cwmode==0){
cwmode=1;
overworld.runCommandAsync('say 灭世模式')}
else if(cwmode==1){
cwmode=0;
overworld.runCommandAsync('say 普通模式')}}else if(cwui.selection==4){
if(cwdamage==0){cwdamage=1,overworld.runCommandAsync('say 反伤开启')}
else if(cwdamage==1){cwdamage=0,overworld.runCommandAsync('say 反伤关闭')}};if(cwui.selection==5){
if(cwftp==0){cwftp=1;
overworld.runCommandAsync('say 开启反tp')}
else if(cwftp==1){cwftp=0;
cwlocation=0;
cwlocationa=0;
cwlocationb=0;
cwlocationc=0;
overworld.runCommandAsync('say 关闭反tp')}};
if(cwui.selection==6){
if(cwpmod==0){
player.runCommandAsync('say az');
cwpmod==1}
else if(cwmod==1){
player.runCommandAsync('say az');
cwpmod==0}}})}; |
3#2023-3-25 21:51:14回复(0)收起回复 |