Minecraft class is the core client-side class that manages the game instance, including rendering, player management, level handling, and game loop execution.
Constructor
Component*
Component for mouse input handling
Canvas*
Parent canvas for rendering
MinecraftApplet*
Applet context (can be NULL)
int
Display width
int
Display height
bool
Whether to run in fullscreen mode
Core Methods
init
run
run_middle
run() to allow integration with platform-specific game loops (Xbox, PlayStation).
run_end
tick
bool
True for the first active viewport in splitscreen
bool
True if renderer textures should be updated
destroy
Level Management
setLevel
MultiPlayerLevel*
The level to set as active
int
default:"-1"
Message ID to display during level transition
shared_ptr<Player>
default:"nullptr"
Player to force insert into the level
bool
default:"true"
Whether to force save player statistics
bool
default:"false"
Whether the primary player signed out
getLevel
int
Dimension ID (0 = Overworld, -1 = Nether, 1 = The End)
selectLevel
releaseLevel
Player Management
createPrimaryLocalPlayer
int
Input device index (0-3 for Xbox/PlayStation controllers)
createExtraLocalPlayer
int
Player index (0-3)
const wstring&
Player name
int
Controller pad index
int
Starting dimension
addLocalPlayer
removeLocalPlayerIdx
setLocalPlayerIdx
getLocalPlayerIdx
Screen Management
setScreen
Screen*
The screen to display (NULL for in-game)
getScreen
pauseGame
Connection Management
connectTo
const wstring&
Server address or hostname
int
Server port number
getConnection
int
Player input device index
clearConnectionFailed
Utility Methods
GetInstance
getAspectRatio
getLevelSource
getWorkingDirectory
onWindowResize
emergencySave
Public Member Variables
int
Current display width
int
Current display height
int
Physical framebuffer width
int
Physical framebuffer height
MultiPlayerLevel*
Current active level
shared_ptr<MultiplayerLocalPlayer>
Current local player
shared_ptr<MultiplayerLocalPlayer>[4]
Array of all local players for splitscreen
MultiPlayerGameMode*
Current game mode handler
Textures*
Texture manager
Options*
Game options and settings
SoundEngine*
Sound and music manager
Gui*
In-game GUI renderer
LevelRenderer*
Level/world renderer
GameRenderer*
Main game renderer
volatile bool
Whether the game is paused
volatile bool
Whether the game is running
TexturePackRepository*
Texture pack/skin repository
Static Constants
Example Usage
Creating a Minecraft Instance
Loading a World
Managing Splitscreen Players
Connecting to a Server
Thread Safety
Platform Considerations
The Minecraft class includes platform-specific code for:- Xbox (DURANGO)
- PlayStation (ORBIS)
- PC (WINDOWS64)
- PS Vita (PSVITA)