Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invisible world in 1.19.1 as well as latest #175

Closed
3top1a opened this issue Mar 27, 2021 · 13 comments
Closed

Invisible world in 1.19.1 as well as latest #175

3top1a opened this issue Mar 27, 2021 · 13 comments

Comments

@3top1a
Copy link
Contributor

3top1a commented Mar 27, 2021

Screenshot_2021-03-27_21-35-04

The world is missing, but click to move still works, so the world is just not rendering.

@3top1a
Copy link
Contributor Author

3top1a commented Mar 27, 2021

I also tried this in not-so-extention-heavy Brave, but the same issue still persisted.

@rom1504
Copy link
Member

rom1504 commented Mar 27, 2021

What is 1.19.1 ?

@3top1a
Copy link
Contributor Author

3top1a commented Mar 28, 2021

The viewer version

@rom1504
Copy link
Member

rom1504 commented Mar 28, 2021

What code are you running?
Any error in dev console?

@3top1a
Copy link
Contributor Author

3top1a commented Mar 28, 2021

I tried both the latest commit (fb7b9d3) and 1.19.1.

Both had an empty world

@rom1504
Copy link
Member

rom1504 commented Mar 28, 2021

What code are you running?
Any error in chrome dev console?

@3top1a
Copy link
Contributor Author

3top1a commented Mar 28, 2021

I get one error:

TypeError: can't convert undefined to object

@rom1504
Copy link
Member

rom1504 commented Mar 28, 2021

What's the full error ?
What code are you running?

@3top1a
Copy link
Contributor Author

3top1a commented Mar 28, 2021

1.19.1,
image

@rom1504
Copy link
Member

rom1504 commented Mar 28, 2021

1.19.1 is the version of prismarine-viewer it's not the code you ran.
What code did you run?
Until you give more information it's going to be hard to help you

@3top1a
Copy link
Contributor Author

3top1a commented Mar 28, 2021

The click to move example, modified a bit:

const mineflayer = require('mineflayer');
const mineflayerViewer = require('prismarine-viewer').mineflayer

const { pathfinder, Movements } = require('mineflayer-pathfinder')
const { GoalBlock } = require('mineflayer-pathfinder').goals

username = null;
password = null;
server_ip = null;
port = null;
bot = null;

exports.connect = function() {
  console.log("teet");
  bot = mineflayer.createBot({
    host: server_ip,
    port: port,
    username: username,
    password: password,
    version: "1.12.2"
  });
}

exports.viewer = function(){
  bot.loadPlugin(pathfinder)
  mineflayerViewer(bot, { port: 3001 })

  bot.on('path_update', (r) => {
    const nodesPerTick = (r.visitedNodes * 50 / r.time).toFixed(2)
    console.log(`I can get there in ${r.path.length} moves. Computation took ${r.time.toFixed(2)} ms (${nodesPerTick} nodes/tick). ${r.status}`)
    const path = [bot.entity.position.offset(0, 0.5, 0)]
    for (const node of r.path) {
      path.push({ x: node.x, y: node.y + 0.5, z: node.z })
    }
    bot.viewer.drawLine('path', path, 0xff00ff)
  })

  const mcData = require('minecraft-data')(bot.version)
  const defaultMove = new Movements(bot, mcData)

  bot.viewer.on('blockClicked', (block, face, button) => {
    if (button !== 2) return // only right click

    const p = block.position.offset(0, 1, 0)

    bot.pathfinder.setMovements(defaultMove)
    bot.pathfinder.setGoal(new GoalBlock(p.x, p.y, p.z))
  })
}                                                                                                                                                      

@3top1a
Copy link
Contributor Author

3top1a commented Mar 30, 2021

image
There's something wrong with the tints, I'll check

@3top1a
Copy link
Contributor Author

3top1a commented Mar 30, 2021

I just installed the latest updates and it worked

@3top1a 3top1a closed this as completed Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants