Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
c35ba92
Create a page for Item
KonSola5 Dec 22, 2025
116612b
Test en.yml
KonSola5 Dec 22, 2025
0e6d772
why were the dashes here
Donaldino7712 Dec 22, 2025
6927883
Add components
KonSola5 Dec 22, 2025
ce02483
Double backticks?
KonSola5 Dec 22, 2025
4c53de6
That was bad, go back
KonSola5 Dec 22, 2025
eeaef98
Add brackets to placeholders instead
KonSola5 Dec 22, 2025
550a2ad
Escape maybe?
KonSola5 Dec 22, 2025
e998bef
Another attempt
KonSola5 Dec 22, 2025
496b579
Is the bracket a problem?
KonSola5 Dec 22, 2025
e5dac15
x
KonSola5 Dec 22, 2025
ece391b
Put a backslash
KonSola5 Dec 22, 2025
ec16bbe
Hmm?
KonSola5 Dec 22, 2025
088c1d1
Can I nest colors?
KonSola5 Dec 22, 2025
6bdf26a
Maybe the discolor is caused by HTML parsing bug?
KonSola5 Dec 22, 2025
8c21e98
No, it isn't
KonSola5 Dec 22, 2025
683907b
Remove blue
KonSola5 Dec 22, 2025
fbba652
This is it, I think
KonSola5 Dec 22, 2025
c761bc8
No
KonSola5 Dec 22, 2025
2c9679a
Test
KonSola5 Dec 22, 2025
0dcb93f
Maybe zero-width spaces will avoid ligatures?
KonSola5 Dec 22, 2025
56758ac
Finally?
KonSola5 Dec 22, 2025
ab7363e
Add zero-wide spaces in placeholders
KonSola5 Dec 22, 2025
a248fa3
Escape the square brackets
KonSola5 Dec 22, 2025
5cdf821
Add ItemStack stub and documentation for ItemWrapper
KonSola5 Dec 22, 2025
839167e
Update ItemStack page
KonSola5 Dec 23, 2025
9fa2782
Add syntaxes for sized ingredients
KonSola5 Dec 23, 2025
1e07e4a
Remove the duplicate mention of SizedIngredient syntax as it was adde…
KonSola5 Dec 23, 2025
314892a
Reword and add more info to ItemStack article
KonSola5 Dec 24, 2025
6e8d8fc
Add line break
KonSola5 Dec 24, 2025
e397b61
Testing something
KonSola5 Dec 24, 2025
d401934
Yep, that's definitely a CSS injection
KonSola5 Dec 24, 2025
6abc4e6
It makes for a cool Optional badge
KonSola5 Dec 24, 2025
ef6d2d0
Does it inject HTML???
KonSola5 Dec 24, 2025
1546cc8
Revert "Does it inject HTML???"
KonSola5 Dec 24, 2025
b85adf6
Maybe fix JS block?
KonSola5 Dec 24, 2025
186734a
Document Data Components
KonSola5 Dec 24, 2025
4d5a1af
Whoops, broken link
KonSola5 Dec 24, 2025
3264cb3
Change grammar a bit
KonSola5 Dec 24, 2025
7944701
Add `item` before methods where I forgot to add `item`
KonSola5 Dec 24, 2025
2395d08
Document BlockWrapper
KonSola5 Dec 25, 2025
1395756
Fix broken links, add horizontal lines
KonSola5 Dec 25, 2025
53704cb
Add horizontal lines to ItemWrapper article as well
KonSola5 Dec 25, 2025
f1d5c70
Test moving article into subfolder, axe redundant ref articles
KonSola5 Dec 25, 2025
4b9e6e0
Perestroika in `ref`
KonSola5 Dec 25, 2025
5b898fc
Document Java functional interfaces
KonSola5 Dec 25, 2025
0376e9f
Start documenting blocks (`LevelBlock`)
KonSola5 Dec 30, 2025
13f0161
Do I really need a variable block every time I want a code block toge…
KonSola5 Dec 30, 2025
87d36c6
Document up to `block.explode`, add ExplosionProperties page
KonSola5 Dec 30, 2025
6304091
Can't espace in codeblocks
KonSola5 Dec 30, 2025
59cfafd
Some block-related changes
KonSola5 Dec 31, 2025
f33537a
Of course this Markdown does not Markdown
KonSola5 Dec 31, 2025
d78f15d
Can't have link inside codeblock, only codeblock inside link
KonSola5 Dec 31, 2025
db444a5
Finally, complete documentation of LevelBlock
KonSola5 Dec 31, 2025
b010f42
Typo
KonSola5 Dec 31, 2025
93ede98
Document record usage
KonSola5 Jan 1, 2026
f62e083
Multiline placeholder attempt 2
KonSola5 Jan 1, 2026
fd96b7e
Single line then. Sigh
KonSola5 Jan 1, 2026
885c496
This YAML does not YAML
KonSola5 Jan 1, 2026
e6e8aab
I give up, let there be duplicate links
KonSola5 Jan 1, 2026
ba22696
Document JavaWrapper
KonSola5 Jan 5, 2026
8f4e9b8
"or not found"
KonSola5 Jan 6, 2026
7394974
Document UtilsWrapper
KonSola5 Jan 6, 2026
3be0bf4
Fix formatting?
KonSola5 Jan 6, 2026
d70ec46
Ah, the indent was a problem
KonSola5 Jan 6, 2026
77ca74b
Fix mistakes
KonSola5 Jan 6, 2026
7ff5db9
More fixes
KonSola5 Jan 6, 2026
047ba9a
Even more fixes
KonSola5 Jan 6, 2026
174f329
Document IngredientWrapper
KonSola5 Jan 7, 2026
7ec4cff
Fix formatting
KonSola5 Jan 7, 2026
e2e2e8d
I accidentally quoted the link
KonSola5 Jan 7, 2026
8b69cec
Document StringUtils
KonSola5 Jan 7, 2026
b609977
Add static fields to documentation
KonSola5 Jan 7, 2026
54b21d6
Fix spelling
KonSola5 Jan 7, 2026
cf0a483
Try modifying the global scope page
KonSola5 Jan 8, 2026
32020ac
Fix formatting
KonSola5 Jan 8, 2026
90ad6bd
Remove the old table, add horizontal lines
KonSola5 Jan 9, 2026
2477932
Test color table
KonSola5 Jan 9, 2026
5d6519f
Now?
KonSola5 Jan 9, 2026
ce44164
Hmm?
KonSola5 Jan 9, 2026
214b25b
Test one
KonSola5 Jan 9, 2026
6096a5e
Test two
KonSola5 Jan 9, 2026
69b93d9
Test three
KonSola5 Jan 9, 2026
1b0dcfe
Try putting space
KonSola5 Jan 9, 2026
78776b4
Must the BG color be directly adjacent to pipe?
KonSola5 Jan 9, 2026
1abc8a8
Cell bg colors must stick to pipes
KonSola5 Jan 9, 2026
560befd
Sort colors by hue
KonSola5 Jan 9, 2026
56e2fab
Document ColorWrapper, rename "returns" to "return value"
KonSola5 Jan 9, 2026
7cb9a29
Add some horizontal lines
KonSola5 Jan 9, 2026
9416a54
Document KubeColor and link ColorWrapper to KubeColor
KonSola5 Jan 9, 2026
148daec
Fix formatting
KonSola5 Jan 9, 2026
db13f31
"text color returned by getRGB", not #RRGGBB
KonSola5 Jan 9, 2026
e524269
Start Entity documentation
KonSola5 Jan 11, 2026
c87714d
Info, not note
KonSola5 Jan 11, 2026
b268c6f
Anchor link test
KonSola5 Jan 11, 2026
b486fec
Another test
KonSola5 Jan 11, 2026
d8e8be2
Yet another test
KonSola5 Jan 11, 2026
17d9b8c
More Entity methods
KonSola5 Jan 11, 2026
9c159dd
More progress
KonSola5 Jan 12, 2026
2b4b641
Explicit BlockPos and Vec3 doesn't disambiguate
KonSola5 Jan 12, 2026
a73b9b6
Few more changes
KonSola5 Jan 22, 2026
a8d895b
Even more changes
KonSola5 Jan 24, 2026
408cfff
`glowing` is in fact a full accessor bean
KonSola5 Jan 24, 2026
4ecb2de
Rename remapped methods documented so far
KonSola5 Jan 24, 2026
30543e2
More changes
KonSola5 Jan 25, 2026
d9e77f3
How documentation would look in tables?
KonSola5 Jan 25, 2026
334d8d7
Transparency?
KonSola5 Jan 25, 2026
f5f879c
Test
KonSola5 Jan 26, 2026
5d32300
Test 2
KonSola5 Jan 26, 2026
278b8da
Test 3
KonSola5 Jan 26, 2026
ccd683f
I give up
KonSola5 Jan 26, 2026
76a144f
Put everything into tables
KonSola5 Jan 26, 2026
67974ef
Fix
KonSola5 Jan 26, 2026
a541c24
Fix 2
KonSola5 Jan 26, 2026
ee8494e
More info
KonSola5 Jan 27, 2026
0f51811
Fix "false" text
KonSola5 Jan 27, 2026
a1cc7cc
Things
KonSola5 Jan 30, 2026
1857a20
Start Scripting Java article
KonSola5 Feb 3, 2026
e45c507
Add stuff
KonSola5 Feb 4, 2026
0f6affe
Disambiguating Java methods example
KonSola5 Feb 4, 2026
f7a6ac6
An impractical example on ambiguous constructor
KonSola5 Feb 4, 2026
9dc6208
Damn you, KJS Wiki parser
KonSola5 Feb 4, 2026
63ef935
Document teleports
KonSola5 Feb 6, 2026
8f3c317
Whoops, I already had a `teleportTo` documentation
KonSola5 Feb 6, 2026
cdbeb65
Fix title
KonSola5 Feb 6, 2026
e5587f1
Type wrapping article test
KonSola5 Feb 18, 2026
6e3a7b9
More conversions
KonSola5 Feb 18, 2026
51cc5c5
Even more conversions
KonSola5 Feb 18, 2026
97132ad
Fix
KonSola5 Feb 18, 2026
6fa1e10
The map is also a JS object
KonSola5 Feb 18, 2026
9c4aa8f
ItemStack conversion
KonSola5 Feb 19, 2026
fe4a262
How would it look with [java]?
KonSola5 Feb 19, 2026
6dc78c0
More colors
KonSola5 Feb 19, 2026
37167af
Document int/float/number provider jank
KonSola5 Feb 20, 2026
9ac4609
Remove float bounds parsing from numberprovider
KonSola5 Feb 20, 2026
9c088d2
Fix
KonSola5 Feb 23, 2026
21f69d7
More conversions
KonSola5 Feb 26, 2026
cc08fe2
fix
KonSola5 Feb 26, 2026
0f4d5d7
All the GSON conversions
KonSola5 Feb 26, 2026
46fcf4e
Actually add the table for JsonElement
KonSola5 Feb 26, 2026
2711cb3
Document duration and path conversions
KonSola5 Mar 6, 2026
20f1bd8
Document ResourceLocation conversions
KonSola5 Mar 6, 2026
65b9c3e
Is <br> the culprit?
KonSola5 Mar 6, 2026
fa11747
No
KonSola5 Mar 6, 2026
60da084
Document NBT tag conversions
KonSola5 Mar 8, 2026
6b7e26d
Fix variable blocks
KonSola5 Mar 8, 2026
a4f24d6
Add some small SlotAccess doc
KonSola5 Mar 20, 2026
6aca969
Entity documentation 75% done
KonSola5 Mar 21, 2026
d5965ed
Position methods documented
KonSola5 Mar 22, 2026
aa86a1e
Getting closer to the end
KonSola5 Mar 24, 2026
4d6b49a
Small fixes
KonSola5 Mar 24, 2026
fd75ffe
More fixes
KonSola5 Mar 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions wiki/concepts/block/Block/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
title: "Block"
description: "The base representation of a Minecraft block"

optional: "#[[#c3c7cb;border:1px solid #51565d;font-size:0.8rem;padding:0.2em 0.3em; border-radius: 1em|Optional]]"
10 changes: 10 additions & 0 deletions wiki/concepts/block/Block/page.kubedoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Creating Blocks

In places where `Block`s are expected, KubeJS will convert strings representing the blocks' ID into `Block` instances.

For example: `[js]'minecraft:stone'`.

# Useful Block methods

In the following examples, `[js]block` will refer to the instance of `Block`.

4 changes: 4 additions & 0 deletions wiki/concepts/block/BlockState/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
title: "BlockState"
description: "Block with states!"

optional: "#[[#c3c7cb;border:1px solid #51565d;font-size:0.8rem;padding:0.2em 0.3em; border-radius: 1em|Optional]]"
6 changes: 6 additions & 0 deletions wiki/concepts/block/BlockState/page.kubedoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Creating BlockStates

In places where `BlockState`s are expected, KubeJS will try to implicitly convert other objects into them.
Most `BlockState`s can be written as string literals, with block property syntax being the same as one used in [`/setblock` or `/fill`](https://minecraft.wiki/w/Argument_types#minecraft:block_state).

# Useful BlockState methods
4 changes: 4 additions & 0 deletions wiki/concepts/block/LevelBlock/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
title: "LevelBlock"
description: "A representation of a block in world"

optional: "#[[#c3c7cb;border:1px solid #51565d;font-size:0.8rem;padding:0.2em 0.3em; border-radius: 1em|Optional]]"
203 changes: 203 additions & 0 deletions wiki/concepts/block/LevelBlock/page.kubedoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
**LevelBlock** is a KubeJS interface defining the script-friendly abstraction of a block in world. LevelBlocks can be easily manipulated to your heart's content.

# How to get LevelBlocks

`LevelBlock`s are usually obtained via block-getting methods on `Level` (object representing the Minecraft world), such as `[js]level.getBlock(x, y, z)`.

# Instance methods

In the following examples, `[js]block` will refer to the instance of `LevelBlock`.

## Position

| Getter | Read-only bean | Description |
| `[js]block.getPos()` | `[js]block.pos` | Gets the position of the block, as BlockPos. |
| `[js]block.getX()` | `[js]block.x` | Gets the x coordinate of the block. |
| `[js]block.getY()` | `[js]block.y` | Gets the y coordinate of the block. |
| `[js]block.getZ()` | `[js]block.z` | Gets the z coordinate of the block. |
| `[js]block.getCenterX()` | `[js]block.centerX` | Gets the x coordinate of the center of the block. |
| `[js]block.getCenterY()` | `[js]block.centerY` | Gets the y coordinate of the center of the block. |
| `[js]block.getCenterZ()` | `[js]block.centerZ` | Gets the z coordinate of the center of the block. |

**Example**
Position related beans on `LevelBlock` make for a useful application of a [destructuring pattern](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring) to quickly get all the block's coordinates to variables.

```js
const { x, y, z } = block
// Now x, y and z constants are respectively the block's x, y and z coordinate.
```

---

## Relative

>>> #get-north
Gets the block to the north of the `block`.
<<<
>>> #get-south
Gets the block to the south of the `block`.
<<<
>>> #get-east
Gets the block to the east of the `block`.
<<<
>>> #get-west
Gets the block to the west of the `block`.
<<<
>>> #get-up
Gets the block above the `block`.
<<<
>>> #get-down
Gets the block below the `block`.
<<<

These getters allow you to get blocks around the currently referenced block, as `LevelBlock`s.

| Getter | Read-only bean | Description |
| `[js]block.getNorth()` | `[js]block.north` | <#get-north> |
| `[js]block.getSouth()` | `[js]block.south` | <#get-south> |
| `[js]block.getEast()` | `[js]block.east` | <#get-east> |
| `[js]block.getWest()` | `[js]block.west` | <#get-west> |
| `[js]block.getUp()` | `[js]block.up` | <#get-up> |
| `[js]block.getDown()` | `[js]block.down` | <#get-down> |
---

## Other

### Accessors

>>> #entity-data
Gets or sets the block entity data (as `CompoundTag`) of the block. The data get or set may be `null`.
<<<
>>> #block-state-note
Gets or sets the BlockState of the block.
**Note**: `setBlockState` also has an overload that allows for setting block update flags, see "Setters".
<<<

| Getter | Setter | Bean | Description |
| `[js]block.getEntityData()` | `[js]block.setEntityData(entityData)` | `[js]block.entityData` | <#entity-data> |
| `[js]block.getBlockState()` | `[js]block.setBlockState(state)` | `[js]block.blockState` | <#block-state-note> |

### Setters

- `[js]block.set(block, properties, updateFlags)`
- `[js]block`: The Block to set the `block` to. It may be a string representing a block, for example `[js]'minecraft:oak_log'`
- `[js]properties` {optional}: Block properties to set on that block. It can be an object representing the block properties, for example `[js]\{ axis: 'x' \}`
- `[js]updateFlags` {optional}: Block update flags. They are a bit map of update properties.

- `[js]block.setBlockState(blockState, updateFlags)`
- `[js]blockState`: The [[/concepts/block/BlockState|`BlockState`]] to set the `block` to. It may be a string representing a block state, for example `[js]'minecraft:oak_log\[axis=x\]'`
- `[js]updateFlags` {optional}: Block update flags. They are a bit map of update properties.

### Getters

>>> #players-in-radius-note
Gets a list of all player entities (as [[/concepts/entity/Entity|`Entity`]] instances) in an 8-block radius, excluding fake players.
**Note**: `getPlayersInRadius` also has an overload with customizable radius, see below this table.
<<<
>>> #inventory-note
Gets the block's inventory (as `InventoryKJS`) accessible from the top of the block.
Will get `[js]null` if the block does not have an inventory.
**Note**: `getInventory` also has an overload with customizable access side, see below this table.
<<<
>>> #can-see-sky
Gets `true` if block can see sky, `false` if it can't.
<<<
>>> #drops-note
Gets the block's drops that are independent of entity and item held (as a list of [[/concepts/item-stack|ItemStacks]]).
Will get an empty list if the block is not on a server-side world.
**Note**: `getDrops` also has an overload with customizable entity and item, see below this table.
<<<

**Parameterless (with beans)**

| Getter | Read-only bean | Description |
| `[js]block.getBiomeId()` | `[js]block.biomeId` | Gets the biome ID as ResourceLocation. |
| `[js]block.getBlock()` | `[js]block.block` | Gets the Block of the block. |
| `[js]block.getBlockLight()` | `[js]block.blockLight` | Gets the block's block light level. |
| `[js]block.getCanSeeSky()` | `[js]block.canSeeSky` | <#can-see-sky> |
| `[js]block.getDimension()` | `[js]block.dimension` | Gets the dimension of the block. |
| `[js]block.getDimensionKey()` | `[js]block.dimensionKey` | Gets the dimension key of the block. |
| `[js]block.getDrops()` | `[js]block.drops` | <#drops-note> |
| `[js]block.getEntity()` | `[js]block.entity` | Gets the block entity of the block. |
| `[js]block.getEntityId()` | `[js]block.entityId` | Gets the block entity ID (as ResourceLocation) of the block. |
| `[js]block.getId()` | `[js]block.id` | Gets the block's ID as string. |
| `[js]block.getIdLocation()` | `[js]block.idLocation` | Gets the block's ID as ResourceLocation. |
| `[js]block.getInventory()` | `[js]block.inventory` | <#inventory-note> |
| `[js]block.getItem()` | `[js]block.item` | Gets the ItemStack corresponding to this block. |
| `[js]block.getKey()` | `[js]block.key` | Gets the block's ResourceKey. |
| `[js]block.getLevel()` | `[js]block.level` | Gets the world the block is in. |
| `[js]block.getLight()` | `[js]block.light` | Gets the block's light level. |
| `[js]block.getMod()` | `[js]block.mod` | Gets the block's mod ID as string. |
| `[js]block.getPlayersInRadius()` | `[js]block.playersInRadius` | <#players-in-radius-note> |
| `[js]block.getProperties()` | `[js]block.properties` | Gets the block's properties. |
| `[js]block.getRegistry()` | `[js]block.registry` | Gets the block registry. |
| `[js]block.getRegistryId()` | `[js]block.registryId` | Gets the block's ResourceKey from the block registry. |
| `[js]block.getSkyLight()` | `[js]block.skyLight` | Gets the block's sky light level. |
| `[js]block.getTagKeys()` | `[js]block.tagKeys` | Gets the list of block's TagKeys. |
| `[js]block.getTags()` | `[js]block.tags` | Gets the list of block's tags as ResourceLocations. |
| `[js]block.getTypeData()` | `[js]block.typeData` | ??? |

**With parameters**

- `[js]block.getInventory()`
- `[js]block.getInventory(direction)`
- `[js]direction` {optional}: A `Direction`. In can be a string representing a direction, for example `[js]'north'`. Defaults to `[js]'up'` if not provided.
- **Return value**: The block's inventory (as `InventoryKJS`) accessible from the specified side. Will get `[js]null` if the block does not have an inventory.

- `[js]block.getDrops()`
- `[js]block.getDrops(entity, heldItem)`
- `[js]entity`: The [[/concepts/entity|`Entity`]] that would break the block. Defaults to `[js]null` if not provided. There's no overload without `heldItem`, so it must be provided too, regardless whether you want to use an item or not.
- `[js]heldItem`: The held item (as [[/concepts/item-stack|ItemStack]]) that would break the block. Defaults to air if not provided.
- **Return value**: The block's drops as a list of [[/concepts/item-stack|ItemStacks]], if the block is on a server-side world, an empty list otherwise.
- This method doesn't break the block, it just simulates the drops for that block.

- `[js]block.getPlayersInRadius()`
- `[js]block.getPlayersInRadius(radius)`
- `[js]radius` {optional}: The radius around the `block` to search players for. Defaults to `8` if not provided.
- **Return value**: All players found (as a list of [[/concepts/entity/Entity|`Entity`]] instances), excluding fake players.
- ==Guarantee==: Entities in this list are guaranteed to be [[/concepts/entity/Player|`Player`]] instances, so documentation for [[/concepts/entity/Player|Player]] applies to those entities as well.

### Other methods

- `[js]block.offset(direction)`
- `[js]block.offset(direction, amount)`
- `[js]direction`: A `Direction`. In can be a string representing a direction, for example `[js]'north'`
- `[js]amount` {optional}: Amount of blocks to move away from the `block`. Defaults to `1` if not provided.
- `[js]block.offset(x, y, z)`
- `[js]x`, `[js]y`, `[js]z`: Amount of blocks to move from the `block` in x, y and z directions respectively.
- **Return value**: A `LevelBlock` representing a block at a specified offset.

- `[js]block.mergeEntityData(entityData)`
- `[js]entityData`: The block entity data (as `CompoundTag`) to merge with existing entity data.

- `[js]block.explode(explosionProperties)`
- `[js]explosionProperties`: The [[/ref/records/ExplosionProperties|explosion properties]] to use.
- **Return value**: An `Explosion` object. Also creates an explosion at the location of the block.

- `[js]block.createEntity(entityType)`
- `[js]entityType`: The type of entity to create. It may be a string representing an entity, for example `[js]'minecraft:creeper'`
- **Return value**: An new [[/concepts/entity/Entity|`Entity`]] object with its position set to the position of the `block` (not its center!). Of course, you still need to spawn the entity, so don't discard the return type!

- `[js]block.spawnLightning()`
- `[js]block.spawnLightning(isEffectOnly)`
- `[js]block.spawnLightning(isEffectOnly, player)`
- `[js]isEffectOnly` {optional}: Whether the lightning is purely visual (that is, harmless). Defaults to `[js]false` if not provided.
- `[js]player` {optional}: A player who caused the lightning.
- Results in a Lightning Bolt spawned at the center of the `block`, optionally with above properties set.

- `[js]block.spawnFireworks(fireworksProperties, flightTime)`
- `[js]fireworksProperties`: The [[/ref/records/Fireworks|firework properties]] to use.
- `[js]flightTime`: Flight time of the firework, in ticks.
- Results in a firework launched from the center of the `block`, with above properties set.

- `[js]block.popItem(item)`
- `[js]item`: The item to pop from the block (as [[/concepts/item-stack|ItemStack]]).
- Results in the specified `[js]item` being popped as an item entity from the location of the block.

- `[js]block.popItemFromFace(item, direction)`
- `[js]item`: The item to pop from the block (as [[/concepts/item-stack|ItemStack]]).
- `[js]direction`: A `Direction`. It can be a string representing a direction, for example `[js]'north'`
- Results in the specified `[js]item` being popped as an item entity from the specified side from the location of the block.

- `[js]block.toBlockStateString()`
- **Return value**: The block's state as a string, with syntax being the same as one used in [`/setblock` or `/fill`](https://minecraft.wiki/w/Argument_types#minecraft:block_state).
4 changes: 4 additions & 0 deletions wiki/concepts/block/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
title: "Block"
description: "It wouldn't be Minecraft if not for blocks!"

optional: "#[[#c3c7cb;border:1px solid #51565d;font-size:0.8rem;padding:0.2em 0.3em; border-radius: 1em|Optional]]"
13 changes: 13 additions & 0 deletions wiki/concepts/block/page.kubedoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
**Blocks** are the very foundation of a Minecraft block.

In the game, their role is split into the following Java objects:
- [[/concepts/block/Block|`Block`]] - which are the singleton objects defining block behavior. These aren't generally used in in-world interactions.

- [[/concepts/block/BlockState|`BlockState`]] - which define additional properties attacked to a block (like axis, being waterlogged, orientation, etc.). These are actual objects stored in world, and can be manipulated.

- [[/concepts/block/LevelBlock|`LevelBlock`]] - a special interface added by KubeJS which abstracts away common cases of manipulating blocks in world.

# See also



40 changes: 39 additions & 1 deletion wiki/concepts/data-components/page.kubedoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,44 @@
WIP!
**Data components** are structured data consisting of key-value pairs, that define various properties of items and block entities, such as their name, lore, enchantments, inventory, etc. Data components can be attached to Items (and thus [[/concepts/item-stack|ItemStacks]]), and block entities.

This article will discuss how you can create data component types and manipulate them.

# Creating DataComponentMaps

In places where DataComponentMap is expected (such as the second argument of `[js]Item.of(item, components)`), you can write:
- String literals with the same string format as you would use in [`/give`](https://minecraft.wiki/w/Argument_types#item_stack).
`minecraft` namespace may be omitted for Minecraft's own data components.

Example: `[js]Item.of('minecraft:diamond_sword', '\[damage=2,lore=[{text:"This item is cool."}]\]')`

- JS objects, representing the key-value pairs. Values will be converted into appropriate NBT objects.
`minecraft` namespace may be omitted for Minecraft's own data components.

Example: `[js]Item.of('minecraft:diamond_sword', { damage: 2, lore: [{ text: "This item is cool." }] })`

# Using DataComponentMaps

In the following examples, `components` will refer to the DataComponentMap.

- `[js]components.get(type)`
- `type` - A component type. It can be a string representing a type, for example `[js]'minecraft:lore'`.
- **Return value**: Value associated with the component type.
- `[js]components.has(type)`
- `type` - A component type. It can be a string representing a type, for example `[js]'minecraft:lore'`.
- **Return value**: `true` is the component has data associated with a type, `false` otherwise.
- `[js]components.isEmpty()`
- **Return value**: `true` is the component contains no data, `false` otherwise.
>>>info
Also available as a **read-only** bean: `components.empty`.
<<<
- `[js]components.keySet()`
- **Return value**: A set of all types (as implementations of `DataComponentType` interface) in the component map.
- `[js]components.size()`
- **Return value**: The amount of keys in the component map.

Just like other read-only maps, `components` also contain `filter` and `forEach` methods.

# Further Reading
- [Minecraft Wiki: Data Component format](https://minecraft.wiki/w/Data_component_format)
- [Data Components | NeoForged docs](https://docs.neoforged.net/docs/1.21.1/items/datacomponents)
- [Data Components | NeoForge docs](https://docs.neoforged.net/docs/1.21.1/items/datacomponents)
- [NBT Data](/concepts/nbt-data)
5 changes: 5 additions & 0 deletions wiki/concepts/entity/Entity/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
title: "Entity"
description: "Everything any entity can do"

optional: "#[[#c3c7cb;border:1px solid #51565d;font-size:0.8rem;padding:0.2em 0.3em; border-radius: 1em|Optional]]"
vec3: "[[/ref/utils/Vec3|`Vec3`]]"
Binary file added wiki/concepts/entity/Entity/get-display-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading