
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
prismarine-viewer
Advanced tools
Web based viewer for servers and bots
npm install prismarine-viewer
const mineflayer = require('mineflayer')
const mineflayerViewer = require('prismarine-viewer').mineflayer
const bot = mineflayer.createBot({
username: 'Bot'
})
bot.once('spawn', () => {
mineflayerViewer(bot, { port: 3000 }) // Start the viewing server on port 3000
// Draw the path followed by the bot
const path = [bot.entity.position.clone()]
bot.on('move', () => {
if (path[path.length - 1].distanceTo(bot.entity.position) > 1) {
path.push(bot.entity.position.clone())
bot.viewer.drawLine('path', path)
}
})
})
More examples:
The core rendering library. It provides Viewer and WorldView which together make it possible to render a minecraft world. Check its API
Serve a webserver allowing to visualize the bot surrounding, in first or third person. Comes with drawing functionnalities.
const { mineflayer } = require('prismarine-viewer')
Options:
viewDistance
view radius, in chunks, default: 6
firstPerson
is the view first person ? default: false
port
the port for the webserver, default: 3000
Serve a webserver allowing to visualize a world.
const { standalone } = require('prismarine-viewer')
Options:
version
the version to use, default: 1.13.2
generator
a world generator function, default: (x, y, z) => 0
center
a vec3 to center the view on, default: new Vec3(0, 0, 0)
viewDistance
view radius, in chunks, default: 6
port
the port for the webserver, default: 3000
Render the bot view and stream it to a file or over TCP.
const { headless } = require('prismarine-viewer')
Options:
viewDistance
view radius, in chunks, default: 6
output
the output file or a host:port
address to stream to, default: output.mp4
frames
number of frames to record, -1
for infinite, default: 200
width
the width of a frame, default: 512
height
the height of a frame, default: 512
All drawing function have a unique id that can be used to replace or erase the primitive.
Draw a line passing through all the points
.
Remove the primitive with the given id from the display.
Stop the server and disconnect users.
node_modules/.bin/jest --verbose --runInBand --forceExit -t "1.16.4"
FAQs
Web based viewer
The npm package prismarine-viewer receives a total of 1,204 weekly downloads. As such, prismarine-viewer popularity was classified as popular.
We found that prismarine-viewer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.