Custom Minecraft Arrows (1.12.2 Java Edition)

Intro: Custom Minecraft Arrows (1.12.2 Java Edition)

Recently, while working on a Minecraft minigame, I thought it would be nice to have different classes, each with different arrows that had different affects. I of course looked to the internet for that, but found no recent guides, and very few sources that actually showed people doing so. I really wanted to be able to do this, so I spent a while working on the project. Now, after a couple weeks, I finally found out how. It was a lot of fun. Now, if you want to do so as well, it isn't as hard as it sounds, and as an added bonus, it can be done in vanilla Minecraft.

Step 1: How It Is Done

If you didn't guess already, this uses command blocks. Because command blocks execute commands, they are not available in regular worlds. You will have to have administrator privileges, and have command blocks enabled if you are using this on a server. If you are making a new world, make sure the "enable cheats" button is set to ON.

Step 2: First Commands

The first step is relatively simple. Get yourself a button, a repeater, some redstone, and a command block. Using the command /give @p minecraft:command_block should grant your character a command block. Place down all of the parts in the order as shown above. The only reason the redstone is active is because the button was pressed, so it was easier to see.

The command blocks will be referenced in order from left to right.

The first command block is optional, along with the last one. The first one I set to /clear @p this will clear the nearest player's inventory, so that in the mini-game the player can't keep other items.

The second one is by far the most important. Set it to give @p minecraft:tipped_arrow 64 0 {CustomPotionEffects:[{Id:14,Amplifier:0,Duration:0}]}. This Will give the nearest play 64 tipped arrows, with a zero tick invisibility affect. The thing that makes this arrow unique from any other invisibility arrow, is the amplifier. The amplifier on invisibility doesn't have an affect, you can't get more invisible, but the game can test for that value. Because the duration is 0, it will not help the player you hit, for the effect will wear off instantly. For each tier, change the amplifier to a new number, but no letters (0, 1, 2, 3, 4, etc...).

In the last command block, I just set to give the nearest player a bow. The command for that is incredibly easy, being only /give @p minecraft:bow. This just makes sure that when the player gets the arrows, they have a completely unenchanted bow to shoot them with.

Step 3: Step 2, the Tough Bit.

In this part, we will be setting down eight repeating command blocks, but nothing else. I set them up in two rows, to keep track of what affect they had, and how many tiers/affects I had.

Place down a command block. In the settings for the block, set it to "repeat" and "always active". This will make the command block run it's command every game tick, or about once every 10th of a second. Paste the command /scoreboard players tag @e[type=Arrow,tag=!Tier1] add Tier1 {CustomPotionEffects:[{Id:14b,Amplifier:0b,Duration:0}]} into the block. This command adds the scoreboard value of Tier1 to any arrow that has the amplifier of 0 on an invisibility arrow, that does not already have the value of Tier1 assigned to it. For each level up in arrows you go, change the 0b after "Amplifier" up by one (0b, 1b, 2b, 3b, 4b, etc), along with Tier1, Tier2, Tier3, etc, respectively. That makes it detect different arrows, and assign them different values.

The second row of command blocks have the same settings (repeat and always active), but they have the command /scoreboard players tag @e[type=Arrow,tag=Tier1] add ActionOne {inGround:1b} in them. This command searches for any arrow with the value of Tier1 (set by the previous command blocks), and checks whether or not it is in the ground. If it is, it assigns it another value, of ActionOne. This makes it so the command blocks in the next step can execute specific commands on the arrow, before eventually killing it.

Step 4: Last Step! Yay.

Open your inventory and get a comparator, a lever, and redstone dust. Place them in a row, as shown above, and pay attention to the orientations of the command blocks.

In command block number 1, the far left purple one, enter the command testfor @e[tag=Tier1]. This will test for any arrows that are labeled as the first tier from the commands in step two. If you flip the lever and then shoot a tier one arrow upwards, the first comparator should light up.

The second command block will get the command testfor@e[type=arrow,tag=ActionOne]. This will make it so that when the arrow it is tracking hits the ground, it triggers the desired output. If you flip the on, and shoot a tier one arrow upwards, the first comparator should turn on. Then, once it hits the ground, the second comparator should turn on.

For now, we will ignore the 3rd command block, and move onto the fourth block, which will get the command kill @e[tag=ActionOne]. This command, very simply, deletes all of the arrows that are tier one, and are in the ground. If you turn on the arrow, shoot a tier one arrow into the air, and watch the comparators once again, the first one should light up, and stay light up. Then, once the arrow hits the ground, the second should light up for a split second, and turn off, at the same time as the arrow disappears. If you try shooting two arrows upwards at the same time, the second comparator should light up twice, and the arrows should disappear at different times.

Now, for the third command block. In this block, put whatever action you want to execute when the arrow hits the ground. It can literally be anything. I personally like to use /execute @e[tag=ActionOne] ~ ~ ~ summon Tnt ~ ~ ~. This will summon an instant explosion at the location of the arrow. The options are endless, and if you want more than one action, add chain command blocks facing up on top of it.

The last and MOST IMPORTANT command block is the last one.If you do not add this, the arrow will not stop executing its programmed command. You need to give command block four the command of /kill @e[tag=ActionOne]. This gets rid of the arrow before the command it executes executes itself again.

Every tier arrow you use, change the ActionOne value up by one. (ActionOne, ActionTwo, ActionThree, etc.).

Step 5: Thanks!

Thanks a ton for reading through this Instructable! I hope that it made sense, and that you are able to put it to good use. As this was my first Instructable, suggestions for improvement are greatly appreciated. If you had any problems, please notify me, and I can try to help, or if someone else had a success, they could help. Again, thanks a ton!

CREDITS:

https://www.reddit.com/r/MinecraftCommands/comment...

https://www.digminecraft.com/game_commands/execute...

Share

    Recommendations

    • Metalworking Contest

      Metalworking Contest
    • Tiny Home Contest

      Tiny Home Contest
    • Fix It! Contest

      Fix It! Contest

    2 Discussions