
DatapacksJava
Get Block
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.

Get Block
This library allows to get block placed at current execution context.

Usage
All functions return result to storage getblock:.
getblock:block
Input: None
Output:
id: ID of the blockshort_id: Un-namespaced ID of the blockstate: State of the blockdata: Data obtained by commanddata get block ~ ~ ~x,y,z: Coordinates of the block
function getblock:block
data get storage getblock: output
{
"id": "minecraft:dispenser",
"short_id": "dispenser",
"state": {
"triggered": "false",
"facing": "north"
},
"data": {
"Items": [],
"x": 0,
"y": 56,
"z": 0,
"id": "minecraft:dispenser"
},
"x": 0,
"y": 56,
"z": 0
}
getblock:id
Get only id
Input: None
Output:
id: ID of the block
{
"id": "minecraft:dispenser"
}
getblock:state
Get only state
Input: None
Output:
state: State of the block
{
"state": {
"triggered": "false",
"facing": "north"
}
}
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.21, 1.21.1, 1.21.2
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Modrinth — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — see the MC Java Mods guides for the full walkthrough.
Verified by MCModsHub
- Downloads as getblock-1.0.2+mc1.21.5.zip
- Download size: 960 KB
- Download link checked 9 Sept 2026 — working
These come from our own check of the pack file, not from the source page.