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

ValueError: invalid literal for int() with base 10: #26

Open
SimonCoulombe opened this issue Nov 17, 2024 · 0 comments
Open

ValueError: invalid literal for int() with base 10: #26

SimonCoulombe opened this issue Nov 17, 2024 · 0 comments

Comments

@SimonCoulombe
Copy link

SimonCoulombe commented Nov 17, 2024

Hey friends

We just got our hands on the book "Adventures in Minecraft" by Martin O'Hanlon and want to get started.

My raspberry pi2 is too old for a raspbian OS with GUI, so we decided to go the RaspberryJuice on windows way. Turns out that wasnt updated since mincraft 1.12, so we were very glad to find your fork.

I mostly got it working. I have 2 issues.

Error #1: ValueError: invalid literal for int() with base 10: 'ed8b326e-a3d8-4f6b-bc73-97843e5465be'

When I run
>>> panda = mc.spawnEntity(pos.x + 3, pos.y, pos.z , "panda")
I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\simon\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mcpi\minecraft.py", line 323, in spawnEntity
    return int(self.conn.sendReceive(b"world.spawnEntity", args))
ValueError: invalid literal for int() with base 10: 'ed8b326e-a3d8-4f6b-bc73-97843e5465be'

The panda does get created in front of me, but I cant do panda.setPos or anything else.

Error #2: mc.setBlock(pos.x+2, pos.y, pos.z, block.WOOL.id, 3) creates a block at the expected location without error. However, it is always a sand block , no matter what I select as block type. (not 100% sure it's sand, but it's always the same).

Any idea?

Environment I use:

  • juicyraspberrypie-1.18.1.jar (from the 2021 release on github)
  • python 3.7.9 (because I saw in your 2019 video you were using 3.7.1, so hopefully I would have a similar version)
  • JAVA 17, because that is the only version of Java that can do java -jar BuildTools.jar --rev 1.18.1
  • in the minecraft launcher I picked version 1.18.1

How I got there:

  • create the following directory structure:

minecraft_py
|-- build
|-- server
|------ plugins

  • Installed Java SDK 17 (exactly 17, not more, not less). Got it from adoptium
  • Downloaded the latest BuildTools version from https://hub.spigotmc.org/jenkins/job/BuildTools/ and saved BuildTools.jar in minecraft_py/build.
  • created a file minecraft_py/build/build.bat with the following content and run it :
@echo off
set "JAVA_HOME=C:\Users\**MYUSERNAME**\AppData\Local\Programs\Eclipse Adoptium\jdk-17.0.13.11-hotspot"
set "PATH=%JAVA_HOME%\bin;%PATH%"
java -jar BuildTools.jar --rev 1.18.1 
pause
  • Copy the generated spigot-1.18.1.jar to minecraft_py/server and rename it spigot.jar
  • create the file minecraft_py/server/eula.txt with content eula=true
  • create the file minecraft_py/server/run.bat with the following content:
@echo off
set "JAVA_HOME=C:\**MYUSERNAME**\simon\AppData\Local\Programs\Eclipse Adoptium\jdk-17.0.13.11-hotspot"  
set "PATH=%JAVA_HOME%\bin;%PATH%"  
java -Xms8G -Xmx8G  -jar spigot.jar  
pause  
  • download juicyraspberrypie-1.18.1.jar release for spigot 1.18.1 from releases here on github at https://github.com/wensheng/JuicyRaspberryPie/releases/tag/v0.3 then save it to to minecraft_py/server/plugins
  • start the spigot server by double-clicking run.bat
  • start the minecraft launcher, create a new installation, select release 1.18.1.
  • start a new minecraft game, pick multiplayer, "localhost"
  • install python 3.7.9 for windows , start IDLE.

import mcpi.minecraft as minecraft
import mcpi.block as block
mc = minecraft.Minecraft.create()
pos = mc.player.getTilePos()
panda = mc.spawnEntity(pos.x + 3, pos.y, pos.z , "panda")
mc.setBlock(pos.x + 3, pos.y + 2, pos.z, block.STONE.id)

I also tried:

  • edit minecraft_py/server/plugins/JuicyRaspberryPie/config.yml to have this line:
    pyexe: "C:\\Users\\YOURUSERNAME\\AppData\\Local\\Programs\\Python\\Python37-32\\python.exe"

  • Try with juicyraspberry-1.14.4, Java 11 and Python 3.7.9

  • Personal notes for in-game setup:

    • in server terminal type op YOURMINECRAFTUSERNAME
    • in minecraft chat type /gamemode creative
    • in game, disable pausing on loss of focus: hold f3, press p
    • in game press F3 to show location, then face east
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

1 participant