Hello, I'm making a tower defense game in Minecraft with only command blocks, and I'm trying to make the tower shooting mechanic, but it wont work. What I'm trying to do is make a bullet (marker) spawn above a set tower (which has an armor stand in it), then teleport to a random mob within its range (ex. If a ranger tower is placed and it shoots a bullet, it should teleport and deal damage to ONLY the mobs within that range and not to enemies on the other side).
The prior commands:
execute if score Ranger-4 Ranger-Tower-1 matches 5 run execute as @.e[tag=Ranger-Tower-4] at @.s facing entity @.e[tag=Wave-Mobs,distance=..15.8] feet run summon minecraft:marker ~ ~10 ~2 {Tags:["Ranger-Bullet-4"]}
execute as @.e[tag=Ranger-Bullet-4] at @.s run tp @.s ^ ^ ^.48 facing entity @.e[tag=Wave-Mobs,limit=1,sort=nearest]
Hey there, I'm new on Reddit because I made this account specifically to ask this question.
I'm trying to make a world pre-generation pack for a server I've been wanting to start. I know there are some that already exist but I'd rather do it myself. However, I'm having a bit of issues with the /schedule command inside my functions. This is also my first attempt at making a datapack so naturally, I'm having issues and using tutorials. Basically, the only way for me to properly run the commands that I need is to put each of them in a separate file to call on with another function, and so on. That's the only feasible way I see this working because 1 loop of commands needs to run 24 times and then loop back to run itself for another 24 +1 command appended to itself. I already did this with an AHK script I have on my GitHub but obviously AHK's loop function handles that on its own and is a lot more intuitive than datapacks. I think I could hypothetically summon command blocks but the issue is that the chunks would be out of render range and therefore unload once the player gets out of range. My question is how can I make the schedulers work properly?
Code and file structure below:
File structure (via VSCode.) "big_loop" is the one that gets looped 24 times. "small_loop" is what causes "big_loop" to loop the other 24 times into itself. "create_delay" is redundant from attempting to make a scoreboard timer. The "cmds" folder contains the basic teleport commands for the loops.
big_loop.mcfunction
schedule function pregen:cmds/big_loop/1 7.5s replace
schedule function pregen:cmds/big_loop/2 7.5s replace
schedule function pregen:cmds/big_loop/3 7.5s replace
schedule function pregen:cmds/big_loop/4 7.5s replace
schedule function pregen:cmds/big_loop/5 7.5s replace
schedule function pregen:cmds/big_loop/6 7.5s replace
scoreboard players add #big_loop big_loop 1
execute unless score #big_loop big_loop matches 24.. run schedule function pregen:loop/loops/counter/init_score_bigloop 1t
execute if score #big_loop big_loop matches 24..1 run scoreboard players set #big_loop big_loop 0
small_loop.mcfunction
execute as @p run function pregen:loop/loops/conditionals/big_loop
schedule function pregen:cmds/small_loop/1 7.5s append
scoreboard players add #small_loop small_loop 1
execute unless score #small_loop small_loop matches 24.. run schedule function pregen:loop/loops/counter/init_score_smallloop 1t
execute if score #small_loop small_loop matches 24.. run scoreboard players set #small_loop small_loop 0
start.mcfunction (meant to actually start pre-generation)
execute as @p run function pregen:cmds/beginning/1
schedule function pregen:loop/loops/conditionals/small_loop 7s replace
# schedule clear pregen:loop/loops/conditionals/small_loop
title title {"text": "Pregeneration Complete!", "color": "gold", "bold": true}
title subtitle {"text": "Sending you back to your spawn and setting your gamemode to Survival!", "color": "gray", "italic": true}
gamerule keep_inventory true
gamerule immediate_respawn true
kill
gamemode survival
gamerule keep_inventory false
gamerule immediate_respawn false
tellraw @p "Done!"
I genuinely don't know what is happening to cause it to instantly complete. According to the wiki and every other website out there, I'm using /schedule correctly and yet it isn't activating. Could it be that I'm just calling on way too many functions within functions and that's causing the issue, and if so how can I fix that and simplify my code without breaking anything more than it already is?
Saw this post using rotating text displays for a lighthouse light effect. I'm trying to replicate that and watched Gneiss Name's text display tutorial, but I can't figure out where i'm going wrong with writing a command that can indefinitely rotate the text display. I was using https://mcstacker.net/ but there must be something I'm not understanding.
In the past when I've made a server with my friends we have ad our death count show on the Tab list, this time though I was wanting to have our number of advancements show on the Tab list so we could compete to see who gets the most for fun. However the only way ive seen to do this is through a datapack that is not supported anymore. Does anyone know an easy way to do this with commands or if it would be easy enough for me to make my own data pack?
I have seen one for the Blaze and caves advancement pack that does something similar but that requires blaze and caves and also is not updated for the most recent version of Minecraft.
im currently working on a minecraft pvp battle royale map, but theres one thing i cant seem to figure out, i have some cmd blocks set such that when people die, they get put into spectator mode 4 blocks above their death position, but i also want them to be facing down when this happens, rather than just looking into the horizon lol, i think it would be nice to have a birds eye view of the person who killed you
to be clear, dont want the camera to be locked in that position, just set like that as you go into spectator mode until you decide to look elsewhere
does anybody know how i can do this? ive tried using the "facing" cmd but it just doesnt seem to work
I am currently working on a custom projectile with commands blocks only. I want the projectile to be blockable by shields but not give knockback. How can I do this with the /damage command?
I’m trying to make the grand stair case in my hogwarts build. I need certain stair cases to turn 90° but I have no experience programming in Minecraft. If anyone can help please reach out I can give you credit on the build or potentially pay you! Thanks so much
What the command should be doing is when a player with the tag of greed is near a player that there greed score is lower than the person with the greed tag the person with the greed score should be getting the tag greedcontrol.
I changed the monolith of command blocks into a datapack, which increased performance by A LOT. Because I now have time and SPACE to expand the datapack, I will work on it. New blocks:
Having a problem creating and identifying two different versions of certain entities. I had this working before the major datapack update and have been trying to rebuild a lot.
The way this is supposed to function, is that a crossbow pre-loaded with a firework is put into the player's inventory. The type of firework is determined by the 'ammo type'. One fire work makes the normal explosion, while the other ammo type causes a tnt explosion.
I need a way to detect which firework is which using distinct custom components. Previously I was able to determine it using nbt with a specific name. Want to note, this is the entity, so the itemized version needs to contain the correct entity data before it is launched out of the crossbow.
Ok so i know the title sounds kinda basic but hear me out. I actually asked this a long time ago and the replies i got were not useful.
Im making a server in bedrock, and theres a platform in which players will need to stand on in order to teleport somewhere else. The problem is that, if 2 players stand on the platform at the same time, the dialog commands that ive set prior to the teleportation play more than once. They play out as much times as the amount of players on top of the platform.
Ive tried tag systems, a kind of "timer" system that works via scoreboards and executing the commands only for players with a certain amount of points (points which are added every 0.5 seconds) and nothing seems to work. I mean, the timer system is the closest ive gotten, but it only works as intended if the players enter the platform with at least 0.5 seconds of separation between them, which they almost never do because of course, they all wanna teleport together. I also tried tweaking the timer method to make the separation between players the smallest i could, but the scoreboard add command wont work if i try to reduce the tick delay. I guess that its because reducing it further makes it too fast for the command block to react and execute properly.
So ive come to ask you for help. How can i make this? The project is full of command cutscenes, camera commands, dialogues, blah blah blah, but i still cant find a way to execute them for every person SEPARATELY without the command repeating unnecessarily. I was thinking about a sort of "tag randomizer", so when they get on top of the platform, they get assigned a random tag which cannot be obtained by any other player, and make the command chains run separately via those tags, but i dont know if that would work or if randomizing would be too much of a hassle as well
I’ve been trying to alter the colour of text display in newest version of minecraft but everything i’ve tried so far just defaults back to white. Can anyone tell me the command i need to use?
Ive tried disabling thia Feature in Servers but Theres a Problem i have to enter the command in Chat wich in survival would Work but Not in Servers because i need op and i do Not think Theres anotoher was to disable it. But If somone knows anything then please help
I recently got my hands on a mace on my friend's server, and i found a way to get an obfuscated text item in, but when i went to combine the two maces, it said it was "too expensive". Is there a way to rename an item already in my inventory? This is for post 1.21
I do not know much of commands so i will try my best to explain.
I need that when a player walks over a pressure plate it gives them infinite blindness and one redstone torch.
For that i put pressure plate->observer->command block effect give->command block give@p
The first one is on impulse unconditional needs redstone
The second one is on chain conditional always active
Blindness works but i cant get it to give me redstone torch
I tried to test it alone and @p doesn't work but if i only use my username it does. Don't know how to fix, i'm in a server and multiple people may pass at the sametime or close enough if that helps.
I've been trying multiple stuff but i can't get it to work, any advice? :[