Gametest-API-Wrapper icon indicating copy to clipboard operation
Gametest-API-Wrapper copied to clipboard

Ask for help

Open cyear opened this issue 3 years ago • 1 comments

How to write the subscription destruction box and how to do HTTP get

import {Commands, World} from 'mojang-minecraft';
/*
    执行指令
/*————*/
const log = function(msg) {
    Commands.run(`tellraw @a {"rawtext":[{"text":"${msg}"}]}`, World.getDimension('overworld'));
}
World.events.BlockBreakEvent.subscribe((event) => {
    /*
        订阅玩家破坏方块消息
    */
    blocks(event);
})
function blocks(event) {
    var blocktype = event.block.id;//方块类型
    var playername = event.player.name;//玩家名称
    log(`${playername} 破坏 ${blocktype}`);
}

cyear avatar Feb 05 '22 01:02 cyear

中文可以吗? 首先我不懂subscription destruction box 是什么逼, 然后gt小fw系统没有node support,不能http或fs。

Mantou1233 avatar Apr 21 '22 10:04 Mantou1233