Questions tagged [minecraft]

Use this tag for programming-related questions about the computer game Minecraft. Note: Minecraft questions are generally OFF-TOPIC on Stack Overflow unless they relate to creating mods/plugins or otherwise developing for the game. Questions related to gameplay are best asked on gaming.stackexchange.com.

Minecraft is a voxel-based sandbox game coded in Java with LWJGL (which includes OpenGL) by Markus "Notch" Persson and his company Mojang.

In September 2014 Mojang was bought by Microsoft and the founders including Notch no longer work for the company. Source.

In the game players interact with the world formed of blocks to gain resources that can be used to create tools, structures, shelter, and eventually, complicated machinery. The game comes with enough features of wiring to allow the complexity to build a full 16-bit CPU out of its wiring.

Multiplayer functionality can be used by downloading a server that runs in Java and takes commands from the command line or from users typing commands starting with a slash / in-game on the server chat.

Questions are also sometimes used with to denote coding Bukkit plugins written in Java, which modify serverside behavior of the game (but cannot add new blocks or items, only new behaviours). Such plugins normally support the CraftBukkit and Spigot implementations of the API, although there are some with specific implementation dependencies. A Bukkit plugin's base plugin class must extend org.bukkit.plugin.java.JavaPlugin for the Bukkit Server class loader to recognize them. Note that as of August 21, 2014 at 8:42 AM, Bukkit has been discontinued, and both CraftBukkit and Spigot (implementations of Bukkit) has been taken down due to DMCA requests.

Clientside mods are usually written using [MinecraftForge] and are capable of adding new blocks and items. For more information about MinecraftForge, see .

Minecraft is available on:

  • PC May 17, 2009 (first public release as Developmental Alpha Version)
  • Xperia Play - August 16, 2011 (Pocket Edition)
  • Android - October 7, 2011 (Pocket Edition)
  • iOS - November 17, 2011 (Pocket Edition)
  • PC - November 18, 2011 (Official Release)
  • Raspberry Pi - February 11, 2013 (Pi Edition based on the Pocket Edition)
  • Playstation 3 - May 14, 2014
  • Playstation 4 - October 3, 2014
  • Xbox 360 - May 9, 2012
  • Xbox One - September 5, 2014
  • Nintendo Switch - May 12, 2017

The game has reached huge levels of popularity and has made a large sensation (Minecraft has now sold over 15 million copies for PC/Mac).

Official website of the game: Minecraft.net

NOTICE: Questions about playing Minecraft are generally OFF-TOPIC on Stack Overflow. Please post on our sister site, Arqade, using one of the following tags depending on which edition of Minecraft you have:

Questions regarding developing mods are, however, on-topic.

3762 questions
5
votes
1 answer

Minecraft Forge EntityJoinWorldEvent returns Wrong Location! Error

Using Forge 1.8.9 in Eclipse (Mars.1 Release (4.5.1)) in local development environment. I'm trying to set a player's location every time they join or re-join a world. It always works the first time (e.g. run and join the world. See first screen…
joseph_pindi
  • 857
  • 2
  • 10
  • 22
5
votes
1 answer

Insert command in already open CMD through a .bat

I coded a website where my friends can start and close their Minecraft server over PHP. To stop their server, a .bat file kills the process, but normally Minecraft servers will be stopped with the "Stop" command. The Minecraft server is running in a…
phrogg
  • 888
  • 1
  • 13
  • 28
5
votes
1 answer

How to stop a repeating task schedule in Bukkit

I am writing a minigame for Minecraft and have a problem with the schedule. I don't know how to stop the schedule. Please tell me how I can stop running this loop / Timer / Schedule: public void WarteTimer() { count =…
STobiasS
  • 75
  • 2
  • 6
5
votes
2 answers

Sending command to java -jar using stdin via /proc/{pid}/fd/0

I'm trying to send a command to a minecraft server jar using /proc/{pid}/fd/0 but the server does not execute the command. To replicate what I'm trying to do you can do this on a Debian based machine (possibly other Linux distributuions…
Joel Bergroth
  • 61
  • 1
  • 3
5
votes
1 answer

Connection refused error in PHP

[06-Nov-2013 17:57:32] PHP Warning: socket_connect() [function.socket-connect]: unable to connect [111]: Connection refused in /home2/whoop/public_html/phptesting/main.php on line 43 I keep getting this error. This is a snippet of code in my…
chargers2143
  • 101
  • 1
  • 2
  • 4
5
votes
1 answer

How do I add a method to a source file without editing the source file?

I am trying to add a method to a Minecraft source file, but I have to figure out how to do it without actually editing the source files, since it is illegal to redistribute source files which would have to be included in the mod I am creating. I…
Andrew Graber
  • 177
  • 4
  • 12
5
votes
1 answer

Preventing damage to a specified player in Bukkit?

I'm trying to make a command that allows you to make any player invulnerable -- that is, god mode. This is my code so far (though it's all boilerplate) @EventHandler public void onEntityDamage(EntityDamageEvent event) { if(event.getEntity()…
Nic
  • 6,211
  • 10
  • 46
  • 69
5
votes
2 answers

Redirect non-HTTP traffic to a port, based on a subdomain

I'm working on making my two Minecraft servers easier to access. I've attempted a few solutions, but so far, none have worked effectively. I have a normal vanilla Minecraft server listening on mysite.com:25560, and a Tekkit Minecraft server…
millinon
  • 1,528
  • 1
  • 20
  • 31
4
votes
2 answers

MySQL Query to get rows in a sphere (X, Y, Z coordinates)?

I am making a plugin for the game called Minecraft with Bukkit API. I have a database table called Reinforcements with the following fields: x integer, y integer, z integer. A reinforcement block is a protected block, meaning it cannot be…
Jonathan
  • 3,016
  • 9
  • 43
  • 74
4
votes
1 answer

Sending Login Packet to Minecraft Server in Python Not Working

I have the following script in Python. What it does is tries to connect to a MineCraft server, first by sending a 'handshake', then sending a login request. The protocol specs can be found here: http://wiki.vg/Protocol Anyway, the python script…
Jack
  • 740
  • 5
  • 21
4
votes
4 answers

What are the standard data structures that can be used to efficiently represent the world of minecraft?

I am thinking of something like a 3x3 matrix for each of the x,y,z coordinates. But that would be a waste of memory since a lot of block spaces are empty. Another solution would be to have a hashmap ((x,y,z) -> BlockObject), but that doesn't seem…
TheOne
  • 10,819
  • 20
  • 81
  • 119
4
votes
3 answers

How do I open a class file with notepad++?

I am opening a minecraft class folder with notepad++. But whenever I open it, it just has a bunch of boxes that say Nul, DC1, SO, SOH, FF, STX, ect... On guides I see that the class file opens just fine, what am I doing wrong?
Madison Young
  • 629
  • 3
  • 8
  • 15
4
votes
2 answers

Dynamic server discovery list

I'd like to create a web service that an application server can contact to add itself to a list of servers implementing the application. Clients could then contact the service to get a list of servers. Something similar to how minecraft's heartbeats…
jterrace
  • 64,866
  • 22
  • 157
  • 202
4
votes
1 answer

Why does invoke not work when using proguard obfuscation

I have a Fabric 1.17.1 (Java 16) mod for Minecraft that I am trying to obfuscate. Included with this mod is my event system that handles all the events for my mod. This event system uses the invoke method to call events in my event listener class at…
MisterCow1
  • 41
  • 4
4
votes
2 answers

How to check if a minecraft server is online and get info of stats (like number of players online) using Discord py

I have a bot that works in a discord server for a minecraft server. I want to make one of the bot's command to ping the minecraft server to check if it is up (or even get stats like number of players). Does anybody know of a way to ping a mc server…
shnap
  • 175
  • 1
  • 1
  • 10