affiliategugl.blogg.se

Setting up powered rails minecraft
Setting up powered rails minecraft




setting up powered rails minecraft

The new MakeCode ground block could have been used to do this. The function MoveMe, which is called by init_beginning (see prior section), moves the player 200 blocks east and to the ground. Finally, this function teleports the player to a convenient position near the control buttons and the Spawn Position.The sunflower is near the northwest corner of the fence. Places a sunflower, which always faces east, just inside the fence so that the coder can conveniently know directions when building the rail.Calls the function set_buttons_and_spawn_position to place the four blocks that will serve as control buttons and to define the variable spawn_position to one block west of the northwest corner of the rail square.Calls the function put_stuff_in_player_inventory to put items that may be useful (e.g., minecarts) in player inventory.

setting up powered rails minecraft

The corners must be placed after the four sides (Minecraft requirement). Calls the function lay_corner_blocks to place the four corners of the rail.Calls the function lay_redstone_and_rail, which builds the powered rail.An on-chat command is used instead of a function so that the fence will be built at the same time as the rail is being laid, thus speeding up the program. Launches “fence,” which is an on-chat command that builds the fence.Calls the function init_sides_and_corners, which sets several variables that provide position and size information about the fence and the rail.This variable will later be used to decide whether to spawn a MOB at the Spawn Position or at a random position inside the rail. Initializes the Boolean variable b_spawn_at_Spawn_Position to true.This counter will be incremented each time a MOB is spawned from the spawn list and, if the MOBs are to be spawned sequentially, will be used as an index into the spawn list to select the next MOB. Initializes the spawn list to be an empty list (array).Sets the position variable “center” to be where the player is initially standing.Moves the player to a new position by calling the function MoveMe.The function init_beginning performs the following actions: Second, they call one of the two function that prepare the spawn list according the specification of the on-chat-command that launched the program.init_beginning and the functions it calls are described in the post. First, they call the function init_beginning, which is the centerpiece function (described below) that prepares the Minecraft world and sets variables to their initial values.

#Setting up powered rails minecraft code#

The code in the not-grayed-out area near the middle of the screenshot below builds the field (e.g., fence, rail and control buttons).Īll the on-chat commands that start the program (described in Part 2), end by calling two functions: The Code that Builds the Field for Riding the Rail






Setting up powered rails minecraft