Skip to main content
GTMC
  • Preface
    • 00Introduction
    • 01Update Concepts and Update Types
    • 02Continuous Block Updates and Analysis Methods
    • 01Tick and Inter-Tick Timing
    • 02A First Look at Intra-Tick Timing
    • 03Scheduled Ticks and Scheduled Tick Components
    • 05Block Entities
    • 06Block Events
    • 01Masa Gadget
    • 02Litematica Tutorial
  • 附录
  • A.Stacks
  • B.Glossary

Table of contents

  • Preface
    • 00Introduction
    • 01Update Concepts and Update Types
    • 02Continuous Block Updates and Analysis Methods
    • 01Tick and Inter-Tick Timing
    • 02A First Look at Intra-Tick Timing
    • 03Scheduled Ticks and Scheduled Tick Components
    • 05Block Entities
    • 06Block Events
    • 01Masa Gadget
    • 02Litematica Tutorial
  • 附录
  • A.Stacks
  • B.Glossary
Loading article content
Loading
Loading article
GTMC

Graduate Texts in Minecraft

"Curiosity in 'cubic' inch."

Preface

Articles
25
Authors
12
Revised
August 2026

Community

  • About
  • Authors
  • Team
  • QQ Group

Participate

  • Contribute
  • Editorial Policy
  • Issues

Source

  • Repository
  • CC BY-NC-SA 4.0
  • Apache-2.0

Not an official Minecraft product. Not affiliated with Mojang Studios.

Contributors retain copyright. Article content is released under CC BY-NC-SA 4.0 with attribution preserved through article metadata and source history.

© 2024–2026 GTMC Collectiveec529be

GTMC

  • Articles
  • PDF
  • Glossary
  • About
  • Authors
  • Preface
    • 00Introduction
    • 01Update Concepts and Update Types
    • 02Continuous Block Updates and Analysis Methods
    • 01Tick and Inter-Tick Timing
    • 02A First Look at Intra-Tick Timing
    • 03Scheduled Ticks and Scheduled Tick Components
    • 05Block Entities
    • 06Block Events
    • 01Masa Gadget
    • 02Litematica Tutorial
  • 附录
  • A.Stacks
  • B.Glossary

Table of contents

  • Preface
    • 00Introduction
    • 01Update Concepts and Update Types
    • 02Continuous Block Updates and Analysis Methods
    • 01Tick and Inter-Tick Timing
    • 02A First Look at Intra-Tick Timing
    • 03Scheduled Ticks and Scheduled Tick Components
    • 05Block Entities
    • 06Block Events
    • 01Masa Gadget
    • 02Litematica Tutorial
  • 附录
  • A.Stacks
  • B.Glossary
Loading article content
Loading
Loading article
APP附录
Path: Appendix/栈.zh.md
Twisuki+3
Word count: 382
Est. read time: 2 min
Last edited: 2026-07-17
Contributors:
  • TTwisuki
  • BBFladderbeanawa
  • hhotpad100c
  • MMolforte
Created:
2025-01-21
Last edited:
2026-07-17
URL:
https://www.techmc.wiki/en/articles/appendix/stack
Reuse
CC BY-NC-SA 4.0
Graduate Texts in Minecraft
Graduate Texts in Minecraft

A. Stacks

This chapter introduces stacks and call stacks, which will help you understand block updates.

1 Understanding Stacks

A stack is a first-in-last-out (FILO) data structure, where elements can only be added or removed at one end.

1.1 First In Last Out

Imagine a Pringles can:

  • Chips can only be placed in from the top, and can only be taken out from the top.
  • Therefore, the chip placed at the bottom first will be the last one that can be taken out.

This is the "first in last out" principle.

1.2 Stack

A stack is like a Pringles can.
In data structure terminology:

  • "Putting chips into the can" corresponds to push;
  • "Taking chips from the top" corresponds to pop.

Additionally:

  • The top of the can is equivalent to the top of the stack
  • The bottom of the can is equivalent to the bottom of the stack

That's a stack.

2 Call Stacks

A call stack is a mechanism that programs use at runtime to manage function calls. It relies on the first-in-last-out rule to ensure functions return correctly.

3 How It Works

Imagine you're making phone calls to ask a question:

  1. You call your friend A to ask a question.
  2. A doesn't know the answer, so they call their friend B to ask.
  3. B isn't sure either, so they call their friend C to ask.

This time, C finds the answer and tells B first.
B then tells A.
Finally, A tells you the answer.

This follows the call stack pattern:

  • Each phone call pushes a new "call task" onto the "call stack".
  • When C is searching for the answer, the task at the top of the stack is "C searching for the answer".
  • After C finds the answer, the most recent call completes first, then returns layer by layer to the callers (B → A → you).
  • Your initial phone call was the first task pushed onto the call stack, so it sits at the bottom of the stack.

In a program:

  • "Making a phone call" is equivalent to calling a function;
  • "Getting an answer and passing it back" is equivalent to a function returning a result.

This way, when functions are nested, the program can ensure each function completes and returns to its caller correctly.

PrevMasa Mod
Litematica Tutorial
Next
Glossary
APP附录
Path: Appendix/栈.zh.md
Twisuki+3
Word count: 382
Est. read time: 2 min
Last edited: 2026-07-17
Contributors:
  • TTwisuki
  • BBFladderbeanawa
  • hhotpad100c
  • MMolforte
Created:
2025-01-21
Last edited:
2026-07-17
URL:
https://www.techmc.wiki/en/articles/appendix/stack
Reuse
CC BY-NC-SA 4.0
Graduate Texts in Minecraft
Graduate Texts in Minecraft

A. Stacks

This chapter introduces stacks and call stacks, which will help you understand block updates.

1 Understanding Stacks

A stack is a first-in-last-out (FILO) data structure, where elements can only be added or removed at one end.

1.1 First In Last Out

Imagine a Pringles can:

  • Chips can only be placed in from the top, and can only be taken out from the top.
  • Therefore, the chip placed at the bottom first will be the last one that can be taken out.

This is the "first in last out" principle.

1.2 Stack

A stack is like a Pringles can.
In data structure terminology:

  • "Putting chips into the can" corresponds to push;
  • "Taking chips from the top" corresponds to pop.

Additionally:

  • The top of the can is equivalent to the top of the stack
  • The bottom of the can is equivalent to the bottom of the stack

That's a stack.

2 Call Stacks

A call stack is a mechanism that programs use at runtime to manage function calls. It relies on the first-in-last-out rule to ensure functions return correctly.

3 How It Works

Imagine you're making phone calls to ask a question:

  1. You call your friend A to ask a question.
  2. A doesn't know the answer, so they call their friend B to ask.
  3. B isn't sure either, so they call their friend C to ask.

This time, C finds the answer and tells B first.
B then tells A.
Finally, A tells you the answer.

This follows the call stack pattern:

  • Each phone call pushes a new "call task" onto the "call stack".
  • When C is searching for the answer, the task at the top of the stack is "C searching for the answer".
  • After C finds the answer, the most recent call completes first, then returns layer by layer to the callers (B → A → you).
  • Your initial phone call was the first task pushed onto the call stack, so it sits at the bottom of the stack.

In a program:

  • "Making a phone call" is equivalent to calling a function;
  • "Getting an answer and passing it back" is equivalent to a function returning a result.

This way, when functions are nested, the program can ensure each function completes and returns to its caller correctly.

PrevMasa Mod
Litematica Tutorial
Next
Glossary