Skip to content

Instantly share code, notes, and snippets.

@jacobsjo
jacobsjo / explanation.md
Last active February 24, 2024 20:41
Minecraft Aquifer Explanation

Aquifers

Minecraft uses Aquifers to determine where to place liquids and air. Without aquifers all empty space below the sea-level would be filled with water. Aquifers thus allow caves to be dry.

Global Fluid Picker

The global fluid picker is used when aquifers are disabled and in some cases with aquifers enabled.

The global fluid picker is quite simple:

  • air above the sea-level
@GentlemanRevvnar
GentlemanRevvnar / 1.18.2-custom_structures_with_jigsaws.md
Last active February 12, 2024 02:09
Simple guide for using jigsaws in custom structures in 1.18.2

Custom data pack structures with jigsaws in 1.18.2

(Last updated: 1.18.2)

This is technically a shameless rip/edit of misode's guide that shows the traditional use of newly implemented custom structure system. I myself want to tackle the jigsaw aspect a bit, hence i'm making my own guice based on his. I will show how to create a data pack that adds custom structures to the world that also utilize jigsaw blocks. So treat this as a basic jigsaw guide in world generation. There is also a data pack download of this first example.

Always leave the world and rejoin to apply the new changes! Because traditional /reload or /datapack disable & enable do not refresh changes in worldgen files!

EXAMPLE 1 - Creating a structure that uses jigsaws

Let's make a simple house with a basement and a road that will lead away from the h

@skyrising
skyrising / mojang-meta-urls.md
Last active April 29, 2024 10:01
Mojang Meta URLs

UPDATE: See: https://github.com/Arcensoth/blueprints

Blueprints

Blueprints are a text-based, human-readable/writable structure format. A blueprint compiles-down to a single NBT structure file that can be loaded with a structure block.

Note that all examples use YAML instead of JSON, but the YAML used is 1:1 convertible to/from JSON.

demo:bricks

{
"parent": "item/handheld",
"textures": {
"layer0": "item/diamond_shovel"
},
"overrides": [
{
"predicate": {
"custom_model_data": 1
},
@Aerijo
Aerijo / tree_sitter_guide.md
Last active March 30, 2024 15:19
Guide to writing your first Tree-sitter grammar

Guide to your first Tree-sitter grammar

NOTE: The Tree-sitter API and documentation has changed and improved since this guide was created. I can't guarantee this is up to date.

About

Tree-sitter is the new way Atom is providing language recognition features, such as syntax highlighting, code folding, autocomplete, and more. In contrast to TextMate grammars, which work by regex matching, Tree-sitter will generate an entire syntax tree. But more on that can be found in it's own docs.

Here, we look at making one from scratch.

@Aerijo
Aerijo / making_language_grammar.md
Last active March 18, 2024 05:03
Guide to writing an Atom language grammar

A guide to writing a language grammar (TextMate) in Atom

Tree sitter

  • Atom is transitioning to an entirely new way of defining grammars using tree-sitter. This will be enabled by default quite soon now. It is theoretically faster and more powerful than regex based grammars (the one described in this guide), but requires a steeper learning curve. My understanding is that regex based grammars will still be supported however (at least until version 2), so this guide can still be useful. To enable it yourself, go to Settings -> Core and check Use Tree Sitter Parsers

Links for tree-sitter help:

@tryashtar
tryashtar / pickup-delay.md
Last active June 7, 2021 13:55
Item PickupDelay table.
Source PickupDelay
Dropped by Player 40
Player Killed 40
Block Broken 10
Mob Killed 10
Dropped by Entity 10
Ejected from Jukebox 10
Broken Container 0
Dispenser/Dropper 0
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 2, 2024 16:19
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux