Giter VIP home page Giter VIP logo

notbeer / gametest-api-wrapper Goto Github PK

View Code? Open in Web Editor NEW
45.0 10.0 23.0 263 KB

Library built off of Minecraft Bedrock Edition Gametest API. Easily allows you to interact with the API, while including a lot more features!

License: MIT License

JavaScript 48.38% TypeScript 51.41% Shell 0.05% Batchfile 0.16%
minecraft-scripts minecraft minecraft-gametest minecraft-plugin minecraft-bedrock-edition mcbe-plugin mcbe-gametest minecraft-custom-commands realms mcbe-realms

gametest-api-wrapper's Introduction

Hello, I'm notbeer


📌 About me

  • 💻 Learning as I work. I'm open to any types of feedbacks!
  • 🤖 I usually develop random websites, AI's, or random softwares.
  • ⚙️ I'm currently learning to work with different types of web app frameworks and TensorFlow.
  • 📂 I like to contribute to open source projects in any way possible.
  • 🏀 In my free time, I love to play basketball, games, or watch movies!

🌐 Socials

Contact me


☄️ Profile




gametest-api-wrapper's People

Contributors

balloonieee avatar jrcarl624 avatar notbeer avatar pmk744 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gametest-api-wrapper's Issues

Misc request

Can u pls add something like a world edit?
It Will be very helpfull for map building and stuff.

tp request/accept

Can you make a tp request/accept I think is possible because I saw a lot of people make it but still have some error

Floating Leaderboard

Why this not working??

`//Importing stuff that is used in this file
import * as Minecraft from 'Minecraft';
import * as allCommands from './commands/export.js';
import * as misc from './utils/misc.js';
import * as utils from './utils/others.js';

var config = {
commandPrefix: "+" //Our custom command prefix
};

Minecraft.World.events.beforeChat.subscribe(chatmsg => { //Event to listen for message being sent in chat
if(!chatmsg.message.startsWith(config.commandPrefix)) return; //If message doesn't start with the prefix don't execute any of the stuff below

const args = chatmsg.message.slice(config.commandPrefix.length).trim().split(/ +/); //args just splits the message by "space" so you can take different inputs of the user message
const commandName = args.shift().toLowerCase(); //The first index of the array from variable "args" will be stored in commandName
const command = allCommands[commandName]; //We look if "commandName" can be found inside "allCommands"

if(!command || (command.commandInfo.ownerOnly && !utils.findTag({ entityRequirements: `[type=player,name="${chatmsg.sender.name}"]` }, { searchTag: 'OWNER'}))) return utils.runCommand(`tellraw "${chatmsg.sender.name}" {"rawtext":[{"text":"§c"},{"translate":"commands.generic.unknown", "with": ["§f${commandName}§c"]}]}`); //Throw error if command doesn't exist OR the command is avaiable to selected players and the player who executed the command isn't one of the selected

if(command.commandInfo.cancelMessage) chatmsg.canceled = true; //This goes to the command file and looks if variable "commandInfo" has a propert "cancelMessage" set to true. If it does it will make sure the message the user sent in chat never actually gets displayed in chat

try { //Try to execute the command file
    command.execute(chatmsg, args, Minecraft);
} catch (error) {
    utils.runCommand(`say : §c${error}`);
};

});

//I seperated these stuff to make stuff more organized
Minecraft.World.events.beforeChat.subscribe(chatmsg => { //Another chat listening event
if(chatmsg.message.startsWith(config.commandPrefix)) return; //If they are trying to execute a custom command don't execute the stuff below
if(utils.findTag({ entityRequirements: [type=player,name="${chatmsg.sender.name}"] }, { searchTag: 'rainbowText'})) chatmsg.message = misc.rainbowText(chatmsg.message); //Look for the tag 'rainbowText' on the player who executed the command, if they have the tag make their chat text to rainbow
misc.displayRank(chatmsg); //This will check if they have a rank, if they do add a rank to their text in chat
});

//!This will execute a function inide it which will be "setTickInterval" only once when the server side is loaded
let tickExeOnce = 0;
Minecraft.World.events.tick.subscribe(() => { //Run stuff inside every world tick
if(tickExeOnce >= 1) return;
utils.runCommand(tellraw @a {"rawtext":[{"text":"§eGameTest FrameWork API Starter Pack§r\n§bCredit: §rThis pack was made by §anotbeer\n§9Discord: §fnotbeer#9204\n§aXbox Live: §fColoringEmy86\n\n§dType §a${config.commandPrefix}help §dfor more information!"}]});
//utils.setTickInterval(startupFunctions, 20);
tickExeOnce++;
});

function startupFunctions() {
misc.writeLeaderboard(
{
floatingTextIdentifier: 'notbeer:floating_text',
leaderboardEntity: 'MoneyL',
objective: 'money',
displayLength: 10
},
{
leaderboardHeading: 'Money Leaderboard\nTop players with the most Money\n§r\n',
leaderboardLayout: '§e#$(RANK) §b$(GAMERTAG) §f- §a$§c$(SCORE)'
},
{
compressScore: false
}
);
};

export { config };
`

Leaderboard

Can you explain how to create a Leaderboard?

The leaderboard

image
i got this to work but the Rank, gamertag, scores are not working

ChatRank

ChatRank is not working in the current update

Ask for help

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}`);
}

Add a broadcast function for translations.

The proposal is simple; create a broadcast function that instead accepts a translation key as an argument, as well as a list of text to substitute within the translation.
This could be implemented using the tellraw command. And could also be extended to errors in custom commands when one is thrown.

Install failed

Screenshot_20240107-101439_Minecraft
install failed on Minecraft Pocket editon 1.20.1
Plz fix it.

Leaderboard Bug

If every player doesn't have at least 1 score in the objective it wont update at all.

home command error

Sometimes the home command does not return the correct coordinate value

Leaderboard

Hello can you help with leaderboard

Regards
RealModking

Database flaw

Database private _getTable() method is broken. Its looping through the dummy players needs to be fixed

Custom command

Can you add some examples docs to create custom command .js file ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.