If you install Raspberry Jam Mod in Minecraft PC version, you can play by moving blocks and players in Minecraft programmatically.
--OS X 10.11 El Capitan or Windows 7
Purchase from Minecraft's Website (US $ 26.95) or install the trial version. (For the trial version, click "Download it here" under "Get Minecraft" on the right side of the site)
When you launch Minecraft, Minecraft Launcher (1.6.48) will be launched.
Set to release 1.8.x.
To install Forge next time, you need to start the world made with 1.8 series once.
--W forward --S retreat --A Horizontal movement to the left --D Horizontal movement to the right --E item list (close with Esc) --Twice space quickly Switch between flight mode / normal mode (Flight mode is creative mode only)
--Space rise (flying mode) / jump (normal mode) --Left Shift descent (flying mode) / crouching (normal mode) --Esc menu screen (settings, publish to LAN, save and return to title), move mouse cursor off screen --T Chat / server command, move mouse cursor off screen
--Mouse cursor Change the viewing direction --Right click place a block --Break the left click block --Select from items in the wheel hot bar (or specify with keys 1-9)
--F1 Head-up display (additional information) Display switching --Taking F2 screenshots Storage location; ・ Mac; ~ / Library / Application Support / minecraft / versions / 1.8-Forge11.14.4.1563 / screenshots -Windows; C: \ Users \ username \ AppData \ Roaming \ .minecraft \ versions \ screenshots
--F3 Debug information display switching, other functions in combination with other keys
--F5 Viewpoint switching (self, from behind, from front) --F11 Full screen display switching (on Mac, even when fn + option + F11)
Install Minecraft Forge to manage mods.
→ ・ [1.8 compatible] Mod introduced to Minecraft on Mac OS X --AQUAALTA → ・ [[Minecraft] You can install this! How to install a modified new mod-Explanation of Forge and folder settings [1.7.10 / 1.8 ~] --Napoan Micra](http://napoan.com/archives/ new-way-to-install-mod.html) → ・ [Minecraft] 1.8 compatible First mod installation method for Windows --AQUAALTA
Start Minecraft again.
"Forge" Profile should be added to "Profile" at the bottom left of Minecraft Launcher, so select it and press the "Edit Profile" button.
Select the Forge version "release 1.8-Forge 11.14.4.1563" installed in "Use Version".
Check "Game Directory" in "Profile Info" and check /Users/username/Library/Application Support/minecraft/versions/1.8-Forge11.14.4.1563 (Mac) or C: \ Users \ Username \ AppData \ Roaming \ .minecraft \ versions \ 1.8-Forge-11.14.4.1563 (Windows) Specify as.
Mac; "Finder"> "Menu"> "Go"> Press the Option key to display "Library", so select it> "Application Support"> "Minecraft"> "versions"> "1.8-Forge 11.14.4.1563" folder Found in.
Windows; Follow as "Computer"> "Local Disk (C :)"> "User"> Username> "AppData"> "Roaming"> ".minecraft"> "versions"> "1.8-Forge-11.14.4.1563" I can go.
Five. After setting, click the "Save Profile" button at the bottom right to save the setting.
Click "releases" at the top of GitHub site of Raspberry Jam Mod. click.
Click "RaspberryJamMod.jar" in "Downloads" of "Latest release (0.51)" to download.
Place the downloaded RaspberryJamMod.jar in "mods" in the directory specified in "Game Directory" earlier (on Mac, / Users / username / Library / Application Support / minecraft / versions / 1.8-Forge11.14.4.1563). Move or copy into the folder.
※ Caution; For Windows, select "RaspberryJamMod.jar" in "Downloads". If you select "RaspberryJamMod-Installer.exe", RaspberryJamMod.jar will be automatically installed in a different folder than the above.
When using Python; Also download "python2-scripts.zip" and "python3-scripts.zip" in "Downloads".
In addition to the Raspberry Jam Mod that supports Minecraft 1.8, there is also a mcpiapi mod that supports 1.7.
Operations such as moving the Minecraft window itself cannot be performed without pressing the Esc key.
Keep the Minecraft World screen open while the program is running. (Not the Launcher screen)
If you are in the same LAN environment, you can share the world (multiplayer) with another person by selecting "Publish to LAN" from the game menu.
$ gem install minecraft-pi-ruby
Successfully installed minecraft-pi-ruby-0.0.1
Parsing documentation for minecraft-pi-ruby-0.0.1
Done installing documentation for minecraft-pi-ruby after 1 seconds
1 gem installed
It lacked functionality compared to Python, so I added it. → ・ https://github.com/noanoa07/minecraft-pi-ruby/tree/feature
$ gem install specific_install
$ gem specific_install https://github.com/noanoa07/minecraft-pi-ruby.git feature
hello.rb
require 'minecraft-pi-ruby'
mc = Minecraft.new
mc.say 'Hello Minecraft World!'
Keep the Minecraft world open;
$ ruby hello.rb
On the screen of Minecraft World;
hello minecraft world!
Is displayed, it is successful!
Can also be executed with irb
For the commands that can be used, refer to Reference A below or [Website] of Minecraft-Pi-Ruby (https://github.com/eaglestone/minecraft-pi-ruby).
Download python2-scripts.zip (for Python2) or python3-scripts.zip (for Python3) from the Raspberry Jam Mod GitHub site And deploy.
The expanded "mcpipy" folder contains various Python sample programs, as well as the "MCPI" folder.
Create it in the same location as the MCPI folder.
hello.py
import mcpi.minecraft as minecraft
mc = minecraft.Minecraft.create()
mc.postToChat("Hello Minecraft World!")
Keep the Minecraft world open;
$ cd mcpipy
$ python hello.py
On the screen of Minecraft
hello minecraft world!
Is displayed, it is successful!
Try running other sample programs in the mcpipy folder.
Can also be executed with an interactive shell
List of instructions;
→ ・ Minecraft API-\
Program written in Python, explanation; → ・ Digital Clock in Minecraft --Raspberry Pi • View topic → ・ Python & Minecraft on Raspberry Pi! --Import minecraft --MCPIPY.com → ・ Python coding for Minecraft --instructables → ・ Adventures in Minecraft-\ <Stuff about = "code" > → ・ Minecraft Pi Recipe Cards --arghbox → ・ Python Programming with Minecraft Pi: Early Draft --arghbox
require 'minecraft-pi-ruby' mc = Minecraft.new
The above two lines are required for execution. (Mc is an arbitrary variable name.)
--set_camera_mode (Raspberry Pi environment only) Set camera mode (: fixed,: normal,: follow)
--set_block (x, y, z, block ID [, block data]) or set_block (position, block ID [, block data])
Example) set_block (0, 0, 0, Block :: STONE) The block ID can be a number Block data can be omitted (Block ID and block data will be described later)
Coordinates can be specified by (x, y, z) or position = Position.new (x, y, z).
Minecraft coordinates are in block units, and the y coordinate is in the height direction (+ on the top)
--get_block (x, y, z) * Original extension Returns the block ID of coordinates (x, y, z)
--set_blocks or make_cuboid Arguments can be specified as (x1, y1, z1, x2, y2, z2, block ID [, block data]) or (position1, position2, block ID [, block data]).
Example) set_blocks (0, 0, 0, 20, 20, 20, Block :: OBSIDIAN) The block ID can be a number Block data can be omitted (Block ID and block data will be described later)
--get_ground_height (x, z) or ground_height (x, z) Returns the ground height (y coordinate) at coordinates (x, z)
--set_player_position (x, y, z) or set_player_position (position) Place the player in coordinates (x, y, z)
--get_player_position * Original extension Returns the player coordinates in the Position class.
--Getting keystrokes It is not possible (currently) to get keystroke information from Minecraft. Also, when the Minecraft window is active, you can't get keystrokes for programs running in the terminal. Therefore, by displaying the Minecraft window while activating the terminal window, the key input information is acquired on the terminal side. (In 3-c. "Settings when switching windows" above, even if another window becomes active, pause it or prevent the game menu from appearing.) You can use Ruby's io / console library to get keystrokes. → ・ Ruby --Get terminal key input and move the cursor (without curses) --Qiita
(license; public domain)
○ Display characters on the screen
hello.rb
require 'minecraft-pi-ruby'
mc = Minecraft.new
mc.say 'Hello Minecraft World!'
○ Flatten the land
reset.rb
require 'minecraft-pi-ruby'
mc = Minecraft.new
sleep 5
mc.say 'Reset this World!'
mc.set_blocks(-100, 0, -100, 100, 63, 100, Block::AIR)
mc.set_blocks(-100, -1, -100, 100, -1, 100, Block::GRASS)
mc.set_blocks(-100, -63, -100, 100, -2, 100, Block::STONE)
mc.set_player_position(0, 100, 0)
○ Place the block on the ground in the shape of a letter
chars.rb
require 'minecraft-pi-ruby'
mc = Minecraft.new
chars = [
'##### # # #### # # #',
'# # # # # # # # #',
'# # # # #### # #',
'#### # # # # # #',
'# # # # # # # ',
'# # #### #### # #',
]
sleep 5
mc.set_player_position(0, 100, 0)
mc.say 'Hello Ruby !'
# Reset the world
mc.set_blocks(-100, 0, -100, 100, 63, 100, Block::AIR)
mc.set_blocks(-100, -1, -100, 100, -1, 100, Block::GRASS)
mc.set_blocks(-100, -63, -100, 100, -2, 100, Block::STONE)
x = -10
y = 0
z = -10
chars.each do |line|
line.each_char do |ch|
if ch == '#'
mc.set_block(x, y, z, Block::GOLD_BLOCK)
end
x += 1
end
x = -10
z += 1
end
Reference) → ・ Study programming while playing with Minecraft Pi Edition! --TONGARISM.COM
○ Display the pressed key
chat.rb
require 'minecraft-pi-ruby'
require 'io/console'
mc = Minecraft.new
mc.say 'chat start!'
# ctrl + C to exit
while ch = STDIN.getch
exit if ch == ?\C-c
mc.say ch
end
0 AIR (air, leave nothing) 1 STONE (stone) 2 GRASS 3 DIRT (Sat) 4 COBBLESTONE (cobblestone) 5 * WOOD_PLANKS 6 * SAPLING (sapling) 7 BEDROCK 8 WATER_FLOWING WATER (Wednesday) 9 * WATER_STATIONARY (stationary water) 10 LAVA_FLOWING LAVA (lava) 11 * LAVA_STATIONARY (stationary lava) 12 SAND 13 GRAVEL 14 GOLD_ORE (gold ore) 15 IRON_ORE (iron ore) 16 COAL_ORE (coal ore) 17 * WOOD 18 * LEAVES 20 GLASS 21 LAPIS_LAZULI_ORE (lapis lazuli ore) 22 LAPIS_LAZULI_BLOCK 24 * SANDSTONE 26 BED 30 COBWEB (cobweb) 31 * GRASS_TALL (grass) 35 * WOOL (wool) 37 FLOWER_YELLOW (yellow flower) 38 FLOWER_CYAN (red rose) 39 MUSHROOM_BROWN (mushroom tea) 40 MUSHROOM_RED (mushroom red) 41 GOLD_BLOCK 42 IRON_BLOCK (iron block) 43 * STONE_SLAB_DOUBLE (overlapping half blocks) 44 * STONE_SLAB (half block) 45 BRICK_BLOCK 46 * TNT (TNT bomb) 47 BOOKSHELF (bookshelf) 48 MOSS_STONE (moss stone) 49 OBSIDIAN (Obsidian) 50 * TORCH (Torches) 51 FIRE 53 * STAIRS_WOOD (Oak tree stairs) 54 * CHEST 56 DIAMOND_ORE (diamond ore) 57 DIAMOND_BLOCK 58 CRAFTING_TABLE (workbench) 60 FARMLAND (arable land) 61 * FURNACE_INACTIVE (Kamado) 62 * FURNACE_ACTIVE (Burning Kamado) 64 DOOR_WOOD (wooden door) 65 * LADDER 67 * STAIRS_COBBLESTONE (log stairs) 71 DOOR_IRON (iron door) 73 REDSTONE_ORE (red stone ore) 78 SNOW (snow) 79 ICE (ice) 80 * SNOW_BLOCK (snow block) 81 CACTUS 82 CLAY 83 SUGAR_CANE (cactus) 85 FENCE 89 GLOWSTONE_BLOCK 95 BEDROCK_INVISIBLE (locked chest) 98 * STONE_BRICK (stone brick) 102 GLASS_PANE (flat glass) 103 MELON (watermelon block) 107 * FENCE_GATE 246 GLOWING_OBSIDIAN (shining obsidian) 247 * NETHER_REACTOR_CORE (Nether Reactor Core)
5 WOOD_PLANKS 0: Oak 1: Spruce 2: Birch 3: Jungle
6 SAPLING (sapling) 0: Oak 1: Spruce 2: Birch 3: Jungle
9 WATER_STATIONARY (stationary water) 11 LAVA_STATIONARY (stationary lava) 0-7: Level of the water, 0 being the highest, 7 the lowest (0-7: height, 0 is the lowest, 7 is the highest)
17 WOOD 0: Oak (up/down) 1: Spruce (up/down) 2: Birch (up/down) 3: Jungle (up/down) 4: Oak (east/west) 5: Spruce (east/west) 6: Birch (east/west) 7: Jungle (east/west) 8: Oak (north/south) 9: Spruce (north/south) 10: Birch (north/south) 11: Jungle (north/south) 12: Oak (only bark) 13: Spruce (only bark) 14: Birch (only bark) 15: Jungle (only bark)
18 LEAVES 1: Oak leaves 2: Spruce leaves 3: Birch leaves
24 SANDSTONE 0: Sandstone 1: Chiseled sandstone 2: Smooth sandstone
31 GRASS_TALL (grass) 0: Shrub 1: Grass 2: Fern 3: Grass (color affected by biome)
35 WOOL (wool) 0: White 1: Orange 2: Magenta 3: Light Blue 4: Yellow 5: Lime 6: Pink 7: Grey 8: Light grey 9: Cyan 10: Purple 11: Blue 12: Brown 13: Green 14: Red 15:Black
43 STONE_SLAB_DOUBLE (stacked half blocks) 44 STONE_SLAB (half block) 0: Stone 1: Sandstone 2: Wooden 3: Cobblestone 4: Brick 5: Stone Brick 6: Nether Brick 7: Quartz
46 TNT (TNT bomb) 0: Inactive 1: Ready to explode
50 TORCH (Torches) 1: Pointing east 2: Pointing west 3: Pointing south 4: Pointing north 5: Facing up
53 STAIRS_WOOD (Oak tree stairs) 67 STAIRS_COBBLESTONE (log stairs) 0: Ascending east 1: Ascending west 2: Ascending south 3: Ascending north 4: Ascending east (upside down) 5: Ascending west (upside down) 6: Ascending south (upside down) 7: Ascending north (upside down)
54 CHEST 61 FURNACE_INACTIVE (Kamado) 62 FURNACE_ACTIVE (Burning Kamado) 65 LADDER 107 FENCE_GATE 2: Facing north 3: Facing south 4: Facing west 5: Facing east
80 SNOW_BLOCK (snow block) 0-7: Height of snow, 0 being the lowest, 7 being the highest. (0-7: Snow height, 0 is the lowest, 7 is the highest)
98 STONE_BRICK (stone brick) 0: Stone brick 1: Mossy stone brick 2: Cracked stone brick 3: Chiseled stone brick
247 NETHER_REACTOR_CORE (Nether Reactor Core) 0: Unused 1: Active 2: Stopped / used up
→ ・ Minecraft API-\
(Continued by "Next" or "View All Steps" at the bottom of the screen)
-Four ways to enjoy programming with Minecraft -How to enjoy programming by putting mods in Minecraft PC version -Minecraft Programming in Ruby -How to move the mouse pointer off the screen in Minecraft and not pause
Recommended Posts