用户:
egg鸡蛋蛋查看:11 回复:3 评论:11 创建时间:2022-05-07T20:15:48
历史记录
是个好东西
啊
(比如你的浏览器历史记录
world.lsjl = []
console.clear()
world.onChat(async ({ entity, message }) => {
if (entity.isPlayer) {
if (message == '历史记录') {
ls()
async function ls() {
const sel = await entity.player.dialog({
type: Box3DialogType.SELECT,
titleTextColor: new Box3RGBAColor(0, 0, 0, 1),
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
contentTextColor: new Box3RGBAColor(0, 0, 0, 1),
contentBackgroundColor: new Box3RGBAColor(1, 1, 1, 1),
title: '历史记录',
content: `
请选择您的操作
`,
options: ['查看历史记录', '删除历史记录'],
})
if (sel) {
if (sel.value == '查看历史记录') {
const sel = await entity.player.dialog({
type: Box3DialogType.SELECT,
title: '历史记录',
content: `
目前有这些历史记录
`,
options: world.lsjl,
})
ls()
}
if (sel.value == '删除历史记录') {
const sel = await entity.player.dialog({
type: Box3DialogType.SELECT,
title: '历史记录',
content: `
请问您要选择哪一种删除方式
`,
options: ['全部删除'],
})
if (sel) {
if (sel.value == '全部删除') {
world.lsjl = []
ls()
entity.player.directMessage('删除成功')
}
}
else {
ls()
}
}
}
return;
}
}
world.lsjl.push(entity.player.name + ':' + message)
console.log(entity.player.name + ':' + world.lsjl)
}
else {
return;
}
})
食用前请查看评论区是否有修正版
/代码版权:egg-鸡蛋蛋/