r/MinecraftCommands

How can I use NBT to detect creatures that are on fire?

My current command is this:

execute at @s at @e[nbt=!{Fire:0},distance=..8] run scoreboard players add @s nearbyflaming 1

The intention of course is to count the nearby flaming creatures.

However, this does not work, and I think I only just figured out why. I think when a creature isn't flaming, it doesn't have a tag of nbt={Fire:0}, it just has no Fire nbt tag at all. But I *do* believe a fire tag exists *in general,* right?

Either way, what's the easiest way to detect if an entity is on fire?

reddit.com
u/StrangeSystem0 — 3 hours ago

15M Chat Model Implemented with Vanilla Commands

A fully functional chat model implemented with only commands, no mods or external API calls, everything's runned locally inside a huge datapack. It is transformer-based (specifically the LLaMA 2 variant of it), which is basically the same architecture that ChatGPT and other LLMs used. However in order to make it work with commands, I have to use a very small model (15 Million Parameters), and the speed is...well quite slow. Actually for this model it takes ~20 minutes to generate a single token, and I believe this demo took me around 24 hours to record (I basically took screenshots every 10 minutes and merged them together in the end). So yeah, just a cool demo, not useful for anything practical at all. You can also try this out for yourself if you're not bothered by the time. Here is the github repo of this project, you can find the download link in it and follow the instructions to use the datapack (I'd also be pretty happy if you give stars to it :D).

I've actually finished this project two months ago but forgot to put it here, but whatever :P

u/This-Purchase-3325 — 5 hours ago
▲ 5 r/MinecraftCommands+1 crossposts

Way to make lights flicker (legit or mods)

I made street lamps on a road in my creative world, but would like to have the lights flicker occasionally creating a spooky or more realistic effect. The street lamps use waxed oxidized copper lanterns I’m pretty sure. Any way to make them flicker

reddit.com
u/IglooKid22 — 11 hours ago

How do I do a /execute command, applying an effect if a player has a different one?

Hey, I'm not very good at commands and I'm trying to get this to work for my server. I have a few different iterations I tried, but none have worked and I want to know if anyone here knows:

/execute at @.a [nbt={active_effects:[{id:"minecraft:effect_1"}]}] run effect give @.a [nbt={active_effects:[{id:"minecraft:effect_1"}]}] minecraft:effect_2 1 0 true

/execute at @.e if entity @.s[nbt={ActiveEffects:[{Id:#effect1idnumber}]}] run effect give @.s minecraft:effect_2 1 0 true

  1. /execute if entity @.a[nbt={active_effects:[{id:"compound_v:nullified"}]}] run effect give @.s compound_v_tweaks:v_destabilization 3 0 true
reddit.com
u/FraidyFazbear — 7 hours ago

How to spawn an entity with your UUID as a tag?

So I have a datapack which adds a certain ability. This ability is that when you crouch, it spawns a certain entity at your position. Everything works, except if you hold crouch, it spawns multiple. I can't make it only work if that entity doesn't exist already bc I want multiple players to be able to use this at the same time. So, I need a very specific way to identify between the different entities. I immediately thought that I could have the player's UUID as a tag, but I can't figure out how to do this, and I have no other ideas. If anybody has another idea, or a way to set a UUID as a tag, please help

reddit.com
u/Still-Oven9420 — 14 hours ago

I made a pin pad for a project

At first, I wanted to make it using dialog menus, but thought without an external UI would be better. Kinda like how it turned out, even though it isn't fully done yet! :)

And not so complicated as I initially thought. The individual interactions have data components and can add their value using a macro into a data storage array (and the text display using multiple "extra" entries). Then the array is checked for the values "back" or "enter" to perform those actions by deleting entries or checking if the array state matches the key sequence.

(For testing, I currently have "1,2,3" and a temporary "1,2,3,4,5,6,7,8,9" code to open the door).

But I have a question: is there a better way to compare the array to the key? Because, when checking using: {pin_pad:[1,2,3]}, it also validates if the order is wrong or there are more entries besides those.

For checking the amount of entries, I test for a potential next (pin_pad[3]), but for the order, I still check all entries individually. Even with a predicate, this isn't ideal.

If anyone knows a simple way to compare the arrays without this, feel free to tell me. Thanks! :)

u/UnfinitePika — 19 hours ago

Commands kill box is too big and I don't understand why.

I am trying to make fire vents that kill you if you touch the fire. I am using this command

execute as @e[tag=Vent] at @s run kill @a[dx=4,dz=0.1]

If you even slightly touch the block that goes along the x axis in front of the vent you die immediately. I would like to make the area smaller but I don't know how. If you also have any ideas on how to make the command work omnidirectionally based on which way the entity with the "Vent" tag is looking that would be very nice.

reddit.com
u/Nalle-poijjaat — 17 hours ago

will the registry of a player quitting happen in the middle of a function

is it possible that a player quits the game while a function is still running, or will the quitting of a player only be registered before or after a tick has finished processing

because i use the /tag command a lot, and when a player quits in the middle of a running function i lose access to the removal of the tag in the subsequent part of the function (all the tags processing finishes within one single tick)

like what if a function is very tidious and takes seconds to finish, and a player hits the "disconnect" button in between, what would happen in the perspective of the function

reddit.com
u/MLE_qwq — 21 hours ago
▲ 1 r/MinecraftCommands+1 crossposts

How to open Minecraft java console?

I got banned off online Minecraft and I have a bypass mod, I tell me to type a command but I don’t know where. I know it’s probably in the games console how do I open it please help.

reddit.com
u/visibletuna16 — 22 hours ago

How to undo "/kill @e"

Accidentally used that command while looking for a different command (specifically one to kill all zombies in my world), and now all of the mobs in my world are dead. Anything I can do to undo this? (And what is the correct command for killing all zombies in my world, and is there also one that can stop them - but not other mobs - from spawning?) Help is appreciated!

reddit.com
u/IcySail441 — 1 day ago
▲ 31 r/MinecraftCommands+2 crossposts

I wanted to give Bedrock Mapmakers the ultimate tool: A custom AI engine for Skyrim-style NPC schedules.

Hey everyone! I don't build maps myself, but I know how much mapmakers struggle with static Bedrock NPCs and the mess of command blocks needed to make them do anything interesting. So, I decided to build a proper solution for you all using the Script API.

In this video, I’m showing off a custom AI engine I'm developing to give NPCs a "Skyrim-style" daily routine.
☀️ Daytime (Working): The NPC walks their custom path and works at the anvil. Since vanilla NPCs are completely stiff, I created a custom animation in Blockbench. My engine has a custom UI where you can just type in the animation name (animation.npc.job), and the script automatically triggers it when the NPC reaches its workstation (essentially automating the /playanimation logic through the API).
🌙 Nighttime (Sleeping): At dusk, the AI dynamically interrupts the route, sends the NPC back to Node 0 (Home), and triggers a custom sleeping animation.

The pathfinding is 100% custom math (no vanilla AI jank) and requires absolutely zero command blocks. My goal is to provide mapmakers with a powerful tool to create living RPG worlds where they can easily plug in their own paths and Blockbench animations.

To all the mapmakers and creators out there: what other features would you want in an AI engine like this?

I need help with detecting if someone has a item in their inventory

I’m trying to make it so if you have a fishing rod it clears you of the tag “dash” but I don’t know how to detect items whatsoever. PLEEEEEEAS HELP🥺🙏

u/Glergedegepshe — 1 day ago

Help with making PvP "match" system

I am making a PvP map with a system that does matches. I need a system that detects if all players [except the last one] on the map have died so that the match ends. I have considered using scoreboards.

reddit.com
u/Appropriate_Show255 — 1 day ago

How to prevent breaking / placing blocks in a certain area

So I’m starting up a realm with custom bosses and weapons with only command blocks, I’m after building the spawn and I’m trying to make it so you can’t build or break anything unless you kinda “buy land” I was going to use the deny blocks but the spawn is like 300 X 300 blocks plus mountains in the back I don’t want anyone touching and like a 50 block radius around spawn before you can break or place anything

With the max playable fill command at like 3k blocks obviously it’s going to take ages, is there any command I can run where it won’t let people do anything within a certain area (that won’t activate on players with bought areas

reddit.com

Pls help me i am going insane

I am currently building hungergames in minecraft and for that i want custom crafting recipes and loottables and so i began build a datapack but i cant make it work for the sake of my life but there is nothing wrong with it i am playing in 26.2

this is my structure

Datapacks

HungerGames

data and pack.mcmeta with following code:{

"pack": {

"description": "This is the description of your data pack",

"min_format": 107.1,

"max_format": 107.1

}

}

then in data:

minecraft:

loot_table:

chest1.json with following code:

{
    "type": "minecraft:chest",
    "pools": [
      {
        "rolls": 5,
        "entries": [
          {
            "type": "minecraft:item",
            "name": "minecraft:iron_nugget",
            "weight": 15,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 6
              }
            ]
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:leather_leggings",
            "weight": 9
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:leather_helmet",
            "weight": 9
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:leather_chestplate",
            "weight": 9
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:leather",
            "weight": 4,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 2
              }
            ]
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:leather_boots",
            "weight": 8
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:copper_axe",
            "weight": 5
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:copper_sword",
            "weight": 5
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:shield",
            "weight": 2
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:crossbow",
            "weight": 3
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:bow",
            "weight": 9
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:stone_sword",
            "weight": 7
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:stick",
            "weight": 10
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:cobblestone",
            "weight": 5,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 3
              }
            ]
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:iron_ingot",
            "weight": 3
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:cooked_beef",
            "weight": 20,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 4
              }
            ]
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:cooked_porkchop",
            "weight": 20,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 4
              }
            ]
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:cooked_mutton",
            "weight": 20,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 4
              }
            ]
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:chainmail_boots",
            "weight": 4
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:chainmail_chestplate",
            "weight": 4
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:chainmail_leggings",
            "weight": 4
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:chainmail_helmet",
            "weight": 4
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:stone_axe",
            "weight": 7
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:arrow",
            "weight": 30,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 6
              }
            ]
          }
        ]
      }
    ]
  }{
    "type": "minecraft:chest",
    "pools": [
      {
        "rolls": 5,
        "entries": [
          {
            "type": "minecraft:item",
            "name": "minecraft:iron_nugget",
            "weight": 15,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 6
              }
            ]
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:leather_leggings",
            "weight": 9
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:leather_helmet",
            "weight": 9
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:leather_chestplate",
            "weight": 9
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:leather",
            "weight": 4,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 2
              }
            ]
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:leather_boots",
            "weight": 8
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:copper_axe",
            "weight": 5
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:copper_sword",
            "weight": 5
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:shield",
            "weight": 2
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:crossbow",
            "weight": 3
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:bow",
            "weight": 9
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:stone_sword",
            "weight": 7
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:stick",
            "weight": 10
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:cobblestone",
            "weight": 5,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 3
              }
            ]
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:iron_ingot",
            "weight": 3
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:cooked_beef",
            "weight": 20,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 4
              }
            ]
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:cooked_porkchop",
            "weight": 20,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 4
              }
            ]
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:cooked_mutton",
            "weight": 20,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 4
              }
            ]
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:chainmail_boots",
            "weight": 4
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:chainmail_chestplate",
            "weight": 4
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:chainmail_leggings",
            "weight": 4
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:chainmail_helmet",
            "weight": 4
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:stone_axe",
            "weight": 7
          },
          {
            "type": "minecraft:item",
            "name": "minecraft:arrow",
            "weight": 30,
            "functions": [
              {
                "function": "minecraft:set_count",
                "count": 6
              }
            ]
          }
        ]
      }
    ]
  } 

please just help me i am new at making datapacks and i am going literally insane the thing is minecraft even sees my datapack because with /datapack list i can see it but i just cant use the loottables it will always just be an empty chest please just help me

reddit.com
u/Mc-Grinder-69 — 1 day ago

Can I spell using fireworks?

Are there any ways I can use fireworks to spell words out?
I want to make a little show for my partner and have it show a short message at the end

I don’t think I can make one with particles that will spell something, unless I’m wrong. I was thinking also maybe making custom flight duration and have multiple exploding in a way it spells something out?

reddit.com
u/xXCensoriousXx — 1 day ago
▲ 9 r/MinecraftCommands+1 crossposts

I’m having trouble with the “ ! “

I’m trying to make it so if the block above the fishing hook is not air then fill the block below it with glass, but it’s not working😔

u/Glergedegepshe — 3 days ago

Randomizer

I want to create a tag randomizer that will give players a small chance to spawn as two different special races and a high chance of just being normal. Is it possible?

reddit.com
u/Mango6926 — 2 days ago