用户:
_SandX_沙叉查看:0 回复:0 评论:0 创建时间:2022-10-02T12:35:32
world.onPress(async({ button, entity }) => {
if(button == Box3ButtonType.ACTION1){
const SCREEN = await entity,player.dialog({
type: Box3DialogType.SELECT,
content: ``,
options: ['控制台']
})
if(SCREEN == null || !SCREEN) return;
switch(SCREEN.index){
case 0:
const CONSOLE = await entity.player.dialog({
type: Box3DialogType.INPUT,
title: `控制台`,
confirmText: `运行`,
placeholder: `在此处输入代码......`,
content: `请输入代码`,
})
if(CONSOLE){
try{
eval(CONSOLE)
}catch(err){
entity.player.directMessage(err)
}
}
break;
default:
}
}
})