minecraft-server-util | js library for Minecraft servers | Runtime Evironment library
kandi X-RAY | minecraft-server-util Summary
kandi X-RAY | minecraft-server-util Summary
A Node.js library for Minecraft servers that can retrieve status, query, RCON, and send Votifier votes.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of minecraft-server-util
minecraft-server-util Key Features
minecraft-server-util Examples and Code Snippets
Community Discussions
Trending Discussions on minecraft-server-util
QUESTION
I am currently making a Minecraft server checker command using minecraft-server-util but everytime I enter the port number in the port option, the error AssertionError [ERR_ASSERTION]: Expected 'port' to be a 'number', got 'object'
comes out. I am currently using the new interaction thing in discord.js v13.
Code:
...ANSWER
Answered 2022-Jan-25 at 08:44The error is that you pass an object as the second parameter here: util.status(server, { port: serverPort })
while it should be the port number:
QUESTION
So i tried to refresh embed every 60 seconds to see updated status of my minecraft server using minecraft-server-util
...ANSWER
Answered 2022-Jan-07 at 23:24You can make this a function that returns the response outside the
QUESTION
i have this simple code in my discord bot to check mc server.
...ANSWER
Answered 2022-Jan-04 at 22:26EDIT Just saw the question's last line about the server being reported as offline when using a number rather than an object. That actually confirms my suspicion below, as you're no longer getting an error from the SDK itself (ie, it seems to be "working," in that it's at least making the network call). I would double-check your address and port number, and ensure the server is accessible from replit.
--- Original response below ---
Difficult to say for sure without knowing the mineutil
API you're using, but it looks like you may be sending more than you need to the mineutil.status()
function (And if you're using this library, I'm fairly certain you are).
I'm guessing that the following line:
return mineutil.status(SERVER_ADDRESS, { port: SERVER_PORT })
which is sending an object `{port: SERVER_PORT}' as its second parameter, should just be sending the number itself. For example:
QUESTION
const {Client, RichEmbed, Intents, MessageEmbed } = require('discord.js');
const bot = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
const token = 'token is a secret';
const PREFIX = '!';
bot.on('ready', () =>{
console.log('Bot has come online.');
});
bot.on('messageCreate', message =>{
let args = message.content.substring(PREFIX.length).split(' ')
switch(args[0]){
case 'mc':
const ping = require('minecraft-server-util')
ping.status('ip', { port: port})
.then((response)=>{
const Embed = new MessageEmbed()
.setTitle('Server Status', )
.addField('Server IP', response.host)
.addField('Server Version', response.version)
.addField('Online Players', response.onlinePlayers)
.addField('Max Players', response.maxPlayers)
message.channel.send({ embeds: [Embed] });
})
.catch((error)=>{console.error(error);});
break
}
})
bot.login(token);
...ANSWER
Answered 2021-Oct-22 at 07:26Try this:
QUESTION
I'm trying to code a bot command using discord.js and Minecraft-server-util but my code is not using the const I defined and is saying it does not exist. If you spot any other problems you can correct me on them.
...ANSWER
Answered 2021-Jun-04 at 14:58The error is due to the scope that you've defined args in. args is defined in your first if statement when it should be defined a line above.
QUESTION
I'm developing a discord bot with .js and I'm using minecraft-server-util. I believe there are several problems and you may correct me on them, but the main problem is that this code returns no embed or message with the status.
...ANSWER
Answered 2021-Jun-04 at 10:53It seems you just placed your embed in your error logger
and not in the .then( ... )
statement. But with the minecraft-server-until
package, I don't know much about it, so if that wasn't the issue, here is the documentation on the package: https://www.npmjs.com/package/minecraft-server-util
Hope this helps you and have fun developing your Discord API!
QUESTION
I am using [this][1] Minecraft server util and I am getting the following error. Is there anyway I can fix this error?
Please note that the error is not when the bot is run its when the command -rcon is run.
This is my code for the command handler, and the command. This is attempting to run the command "list" using rcon.
Code: https://pastebin.com/QWysjvnu
If there is a better way I can be running commands through discord please let me know.
...ANSWER
Answered 2021-May-21 at 20:00Issue #1: You're nesting your module into a parent element named execute
, your module will not be found this way.
Issue #2: Your module has a name of 'mcstats'
, not rcron
. Use the correct name.
Main File:
QUESTION
I made a discord bot that i want to check a minecraft server but the embed has this issue: UnhandledPromiseRejectionWarning: ReferenceError: execute is not defined
my code:
...ANSWER
Answered 2021-May-14 at 23:47I think that you wanted to write
QUESTION
The console displays the id, name of the players, I need to display only the name list.
How can I do this?
Code:
...ANSWER
Answered 2021-Apr-10 at 09:40I think what you're looking for is this:
QUESTION
im using an api to get me mincraft server details it gives me the ip, player count and all that jazz but for the server icon it gives me a base 64url so i need to decode this first inside my discord bot but i am unsure how this could be done https://www.npmjs.com/package/minecraft-server-util this is the api i used if you would like to have a look and incase you need a look at my code so you can show me how to intgrate it this is it
...ANSWER
Answered 2020-Dec-18 at 13:22Solution
It took me a while, and a lot of failed tests, to figure this out. But I finally got it working, and here's the end result:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install minecraft-server-util
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page