-
-
Notifications
You must be signed in to change notification settings - Fork 261
Closed as not planned
Labels
Description
[ ] The FAQ doesn't contain a resolution to my issue
Versions
- minecraft-protocol: 1.16.4
- server: vanilla/spigot/paper 1.16.4
- node: uknown
Detailed description of a problem
Cant make a minecraft server.
Current code
const mc = require('minecraft-protocol');
const client = mc.createClient({
host: "localhost", // optional
port: 25565, // set if you need a port that isn't 25565
username: 'Bot', // username to join as if auth is `offline`, else a unique identifier for this account. Switch if you want to change accounts
// version: false, // only set if you need a specific version or snapshot (ie: "1.8.9" or "1.16.5"), otherwise it's set automatically
// password: '12345678' // set if you want to use password-based auth (may be unreliable). If specified, the `username` must be an email
});
client.on('playerChat', function (ev) {
// Listen for chat messages and echo them back.
const content = ev.formattedMessage
? JSON.parse(ev.formattedMessage)
: ev.unsignedChat
? JSON.parse(ev.unsignedContent)
: ev.plainMessage
const jsonMsg = JSON.parse(packet.message)
if (ev.senderName === client.username) return
client.chat(JSON.stringify(content))
});Expected behavior
Seeing a minecraft world made by this protocol...
Additional context
Add any other context about the problem here.