Posts: 16
Joined: Fri Nov 29, 2013 8:11 pm
Location: Netherlands
Contact: Website

Change Minecraft PI player name

Fri Jun 16, 2017 9:07 pm

For our coderdojo I needed to be able to change the "fixed" player name StevePi for minecraft, so I wrote a simple python script for it. (Tested on the latest Jessie release 2017-04-10)

Here it is, in case somebody else wants to use it.

Code: Select all

# Set the player name (7 chars) for Minecraft PI Edition
# Written by Richard Garsthagen -
# Use at own risk. Please make a backup of minecraft-pi first!

namestart= 1026250


 fh = open("/opt/minecraft-pi/minecraft-pi", "r+b")

 print ("Current name: {} ".format(

 piname = raw_input("New player name: ")

 if len(piname) > 1:
  if len(piname) > 7: piname = piname[:7]
  if len(piname) < 7:
   extraspaces = 7 - len(piname)
   for x in xrange(0,extraspaces):
     piname = piname + " "
  print ("Changed name to:" + piname + " - " + str(len(piname)))
  print ("No new name given")


 print ("Can not change name, is minecraft running? Please close the app first")

Return to “Raspbian”

Who is online

Users browsing this forum: No registered users and 30 guests