Cách xem chunk trong Minecraft PE
Visualization of the ground portion of a single chunk. The entire chunk extends up to a height of 256. Show A chunk is a 256-block (384-block[upcoming: JE 1.18]) tall 16×16 segment of a world. Chunks are the method used by the world generator to divide maps into manageable pieces. Contents
Generation[]Chunks are 16 blocks wide, 16 blocks long, 256 blocks high, and 65,536 blocks total. Chunks generate around players when they first enter the world. As they wander around the world, new chunks generate as needed. Chunks generate with the help of the map seed, which means that the chunks are always the same if you would use the same seed again, as long as the map generator and version number remain the same. Spawn chunks, a 16x16 set of chunks around the world spawn, are always loaded, so you can use that to your advantage when making automatic farms. Chunk loading[]Unloaded chunks in water. Unloaded chunks on land. Since Minecraft worlds are 30 million blocks in each cardinal direction and contain an extreme amount of chunks, the game loads only certain chunks in order to make the game playable. Unloaded chunks are unprocessed by the game and do not process any of the game aspects. Please note that events that can happen when a chunk is loaded, is not the same as events that only happen around the player. For example, normal mob spawning and random tick (determines crop growth, etc.) can only happen near a player, and will not happen in loaded chunks far away from any players. Java Edition[]Tickets[]Loading starts when a chunk receives ticket. All loaded chunks originate from the ticket. Each load ticket has three properties: Level, Ticket type and (optionally) Time to Live. Level and load type[]Levels are numbers that determine what load type the chunk is. Load levels range from 22 to 44 in regular gameplay, while only 22 to 33 are relevant. Load levels less than 22 (including negative levels) are valid but only possible with a modded game. Load levels above 44 are not possible in vanilla. However, it could be possible by modifying the in-game code. For a given chunk, only its lowest level matters. (Lower levels = higher load type.) There are four chunk load types; each load type has different properties. This excludes unloaded chunks. Load Type Level Properties Entity Ticking 31 and below All game aspects are active. Ticking 32 All game aspects are active except that entities are not processed (do not move) and chunk ticks aren't either. Border 33 Only some game aspects are active (Redstone and command blocks do not work). Inaccessible 34 and above No game aspects are active, but world generation still occurs. Level propagation[]Load levels "propagate" or flow from source chunk with a ticket to neighboring chunks, but each time it increases its Level by 1 until the maximum of 44. The chunks that get load level from level expansion activate the assigned load type. Level propagation with a level of 31. Note that levels 35 and more are ignored because they are identical to 34. 34 34 34 34 34 34 34 34 33 33 33 33 33 34 34 33 32 32 32 33 34 34 33 32 31 32 33 34 34 33 32 32 32 33 34 34 33 33 33 33 33 34 34 34 34 34 34 34 34 Same level propagation but with load type instead of Level with abbreviations of the load types. IN IN IN IN IN IN IN IN BO BO BO BO BO IN IN BO TI TI TI BO IN IN BO TI ET TI BO IN IN BO TI TI TI BO IN IN BO BO BO BO BO IN IN IN IN IN IN IN IN Ticket types[]There are different ticket types, which come from various sources and activate chunks with different load types. Player ticket This ticket is caused by the player and is assigned level 31. A player ticket is given to each chunk within an area surrounding the player as defined by the formulas described below and propagates as described in the table above. In singleplayer, the chunk loading distance is one less than the render distance, as configured in Options. It follows the formula (2r - 3)2 = AoC where r is the selected render distance, and AoC is the area of chunks that are assigned an original player ticket (level 31 - entity ticking). The minimum AoC is 9, which means that there is no difference between having the render distance set to 2 or 3. For example, in a single-player game with a render distance of 5 chunks, an area of 7 × 7 chunks centered around the player has a load type of entity ticking (level 31) the immediately enclosing chunks. The strip of chunks at the outer edge of a 9 × 9 perimeter surrounding the player have ticking (level 32), and the next enclosing chunks (11 × 11 perimeter) are border chunks (level 33). In multiplayer, the chunk loading distance is equal to the view-distance, as configured in server.properties. It follows the formula (2v + 1)2 = AoC where v is the configured view-distance, and AoC is the area of chunks that are assigned an original player ticket (level 31 - entity ticking). For example, in a multiplayer server with a configured view-distance of 5 chunks, an area of 11 × 11 chunks centered around the player has a load type of entity ticking (level 31), while the immediately enclosing chunks. The strip of chunks at the outer edge of a 13 × 13 perimeter surrounding the player have ticking (level 32), and the next enclosing chunks (15 × 15 perimeter) are border chunks (level 33). Forced ticket A ticket can also be created by using the /forceload command. It has a level of 31, so its propagation can be seen in the table above. Chunks remain force-loaded even after closing and opening the game. Start ticket Propagation of start ticket Ticket created by the world spawn for the chunk it is located at ("spawn chunks"). Its position can be changed by a /setworldspawn command. It has a level of 22, the lowest in the game. They are active whenever the player is in the Overworld and are otherwise permanently active. Portal ticket Ticket created when an entity is teleported through nether portal, given to chunk at the other side of the portal. It has a level of 30, so it is stronger than the player/force loaded ticket. It expires after 300 game ticks (equivalent to 15 seconds). Because they are created each time an entity passes through the portal, it is possible to create a "chunk loader". Perpetually keeping chunks loaded without the player being near, which can be used for various in-game mechanics such as farms, but can create lag. Dragon ticket Ticket created at the start of the battle with ender dragon and is given to the 0,0 chunk (the one with exit portal). It has a level of 24. It expires after no more players participate in the battle, or the dragon dies. Post-teleport ticket Ticket created when entity is teleported either by going through the end portal or using /teleport or /spreadplayers commands. The /teleport command has a level of 32, whereas, for /spreadplayers and the end portal, it has a level of 33. It expires after 5 game ticks. Temporary ticket Ticket created when an arbitrary piece of game code calls getChunk. If the game code says the chunk should be loaded, it places this ticket on that chunk (after possibly creating it). The load level depends on what kind of chunk the game attempts to load (a fully world-generated chunk or not). It is always level 33 (border) or greater. In many cases, it involves world generation in some way. For example, when a generic mob wandering AI is executing, it asks if a certain block has a solid top surface. As part of that check, that chunk has an "unknown" ticket with level 33 placed on it. Similarly, commands such as /clone, /data, /execute (if|unless) (block|blocks|predicate), /fill and /setblock generate a temporary ticket when reading data from or writing it to a previously loaded chunk; if run every tick, they can prevent the chunk from unloading until the world is reloaded.[1] It expires after 1 game tick. Light ticket Unknown, possibly world-generation related. Limitations[]
Exceptions[]Events in a chunk may affect blocks in outside chunks. If the outside chunk is inactive, the effects are suspended in most cases. Specifically,
Bedrock Edition[]Main article: Ticking areaAll game aspects are active in loading chunks, including chunks within a player's simulation distance and chunks loaded by Commands/tickingarea. Unloaded chunks are unprocessed by the game and do not process any of the game aspects. Type[]Player A round-like shape[more information needed]. Chunks within the simulation distance of a player are loading. Command Create with the /tickingarea command.Limit[]
Exception[]Events in a ticking area may affect blocks in outside chunks. If the outside chunk is inactive, the effects are suspended in most cases. Specifically,
Finding chunk edges[]X and Z coordinates that are divisible by 16 represent the boundaries between chunks. EG: (96, -32) is a corner where four chunks meet. One of those chunks is between X coordinates 80 to 96 and Z coordinates -48 to -32. Another one is between X coordinates 96 to 112 and Z coordinates -32 to -16, and so on. When either X or Z crosses a multiple of 16, the player is moving across chunks. Essentially, the player is in the top-left corner (north-western) of a chunk when both X and Z coordinates are divisible by 16. Additionally, the player can know the chunk they are on by this formula: In Java Edition, the key F3+G can be used to display chunk boundaries. Alternately, pressing the "F3" button opens the Debug screen that shows the player's X, Y, and Z coordinates, in addition to the "chunk" variable. These coordinates change as the player moves around. The player can know the chunk they are in by the variable "chunk". In Bedrock Edition, when toggling fancy graphics, the world renders again, loading only the chunk the player is in for a split second, briefly showing the chunk boundaries. When the player changes the render distance rapidly, chunk barriers appear as a blue line. Also, if in mid-air and bridging with full blocks, when a chunk border is intersected the next block placed will fade into view, showing the chunk border. This is sometimes unreliable, but useful as it only happens on chunk borders. This does not happen underground or when the block placed is close to more than one block. Slime chunks[]Main article: Slime§SpawningSlime chunks are specific chunks capable of spawning slimes below Y=40 regardless of Light. These chunks are otherwise same as all other chunks. Java Edition[]Slime chunks generate throughout the world (except in mushroom islands). 1 in 10 of all chunks is slime chunk. These slime chunks are determined pseudo-randomly by combining their chunk coordinates with the seed of the world: Random rnd = new Random( seed + (int) (xPosition * xPosition * 0x4c1906) + (int) (xPosition * 0x5ac0db) + (int) (zPosition * zPosition) * 0x4307a7L + (int) (zPosition * 0x5f24f) ^ 0x3ad8025f ); return rnd.nextInt(10) == 0; That is, using the chunk coordinates to help generate a seed, a random number between 0 and 9 inclusive is generated, and if that number is 0, the chunk can spawn slimes. To convert world coordinates to chunk coordinates, divide by 16 and round down. Note that xPosition, and zPosition are 32-bit integers (ints). Bedrock Edition[]The slime chunk algorithm in Bedrock Edition is different from in Java Edition. The algorithm doesn't depend on the world seed, thus the chunks that slimes can naturally spawn in are the same for every world.[2] History[]This section needs expansion.You can help by expanding it. Trivia[]
See also[]
References[]
EnvironmentView at: Template:Environment/content [edit] Video liên quan |