Skip to content

Instantly share code, notes, and snippets.

// To subscribe to an event, pass this JSON text to the client through the WebSocket:
{
"body": {
"eventName": "NameOfEvent" // Replace with an event name listed below
},
"header": {
"requestId": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx", // UUID
"messagePurpose": "subscribe",
"version": 1, // Protocol version (currently 1 as-of 1.0.2)
@jocopa3
jocopa3 / CommandRequest.js
Created February 11, 2017 18:46
MCPE/Win10 WebSocket JSON Messages
// For more information about available commands, look at the commands/standard.json file in the game's assets.
{
"body": {
"input": {}, // Command inputs go here
"origin": {
"type": "player" // Where the command originates from
},
"name": "name-of-command", // Command name goes here (i.e. for /say, enter "say")
"version": 1,
@jocopa3
jocopa3 / CalculatorGameSolver.java
Last active December 25, 2023 08:10
A complete solver for "Calculator: The Game"
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Pattern;
public class CalculatorGameSolver {
// Given a single action input (e.x. "1=>5"), returns the appropriate action for that input
public static Action parseAction(String input) {
if (input.matches("\\d+")) {
// e.x.: 12
@jocopa3
jocopa3 / MCPE_1.1.0.1_Ids.txt
Last active December 20, 2023 07:15
List of all Blocks/Items/Entity Id's in MCPE/Win10 1.1.0.1 and EDU Edition
For advanced users, a syntax highlighter for sublime text and
textmate which makes reading the list easier can be found here:
https://gist.github.com/jocopa3/e4a35921e4f978572e7f45360d231f37
============ Blocks ============
All blocks as found in the 1.1.0.0 Block::initBlocks function.
Block names are the same names used in the /give command.
Name Id Data
{
"body": {
"input": {
"message": "Hello World"
},
"origin": {
"type": "player"
},
"name": "say",
"version": 1,
@jocopa3
jocopa3 / Discord ANSI Chart Copy-Paste
Created January 31, 2022 18:47
List of the supported ANSI escape codes in Discord as well as some examples
```ansi
 Discord ANSI Chart 
Escape Char: \u001B, aka: 
Format : ESC[1;31;40mBold Red Text on TealESC[0m
Example : Bold Red Text on Teal
Code │ Regular: 0 │ Bold: 1 │ Underline: 4
─────┼────────────┼────────────┼─────────────
30 │ Gray  │ Gray  │ Gray 
@jocopa3
jocopa3 / Options.cpp
Last active May 9, 2022 01:17
Minecraft Win10 0.16.0 Options Struct
class Options;
class String;
class GamePadRemappingLayout;
class KeyboardRemappingLayout;
class StringPtr;
enum InputMode {
Unknown = 0, // Not used
Mouse = 1,
Touch = 2,
@jocopa3
jocopa3 / BooleanMagic.java
Created February 17, 2022 06:27
Inspired by similar magic tricks to make 2+2=5 through messing with IntegerCache, I present two more devious tricks to make booleans behave in unexpected ways.
import sun.misc.Unsafe;
import java.lang.reflect.Field;
public class BooleanMagic {
private static void doImpossibleBool() {
boolean impossible = ImpossibleBool.IMPOSSIBLE_BOOL;
if (impossible == true) {
System.out.println("Value was true");
} else if (impossible == false) {
# [PackageDev] target_format: plist, ext: tmLanguage
name: Minecraft Addon
scopeName: source.mcaddon
fileTypes: []
uuid: a0c7e4ae-079d-4d09-9b1d-5379c586f67a
patterns:
- include: '#value'
repository:
@jocopa3
jocopa3 / Burning Block Values.txt
Created December 7, 2016 18:34
All fire encouragement and flammability values found in the FireBlock constructor in MCPE 1.0.0
Block Name Encouragement Flammability
WoodPlanks 5 20
DoubleWoodenSlab 5 20
WoodenSlab 5 20
Fence 5 20
FenceGateOak 5 20
SpuceFenceGate 5 20
BirchFenceGate 5 20
JungleFenceGate 5 20