1

Need help/ideas for custom crafting system in vanilla

hokage3211's Avatar hokage321112/15/14 7:17 pm
12/25/2014 9:22 pm
hokage3211's Avatar hokage3211
~Warning: requires knowledge of minecraft command blocks to help~

I am currently trying to make a minecraft custom crafting recipe in vanilla minecraft, now I know this has been done before, but I am trying to make my own stand-alone system that will work even in multiplayer, which has so far seems possible. My end goal is to make the system, then upload it here with a video and begin to instruct people (via detailed instructions and signs) to make their own systems so this custom crafting system becomes something people can learn.

The commands are running on a fill clock, so they are running 20 times per second.

Currently my problem that I need to do is this:
Setting a variable (We can call the variable "IsCrafting") to an armor stand (name=CraftingStand) that is:
-inside of a dropper that matches a block elsewhere (the block to match is at fixed coordinates, the dropper CraftingStand is in has non-fixed coordinates as this needs to be done anywhere in a world)

Also this command seems to be a problem when put into a command block even when the blocks match, but when I say it in minecraft it works just fine:
/execute @e[name=CraftingStand] ~ ~ ~ testforblocks -149 82 131 -149 82 131 ~ ~1 ~ (the last "~1" is because the "CraftingStand" is one block below the Dropper it is monitoring) The repeated coordinates are because there is only one block that needs comparing.

I also feel this command may be just a wrong way to go because this just tests, and I can't do "Set variable to CraftingStand" when this is true and have it attached by a comparator because I imagine there to be multiple CraftingStands going on, and that would set all of their variables when I want to set only one's.

Click to reveal
If you guys need ideas, this is my possible ideas that I think would work for last resorts:
Have the player stand on top of the machine to make it work, so you can test via the player then test for the nearest CraftingStand to set the viable for.
Have a player place some sort of item frame w/ something in it or other unique entity on top of it to make it start crafting, which might be testable since it would be the only one near CraftingStand when it is put down


If I have left something out or you have questions, please ask and I will try to respond quickly and provide the information
Posted by hokage3211's Avatar
hokage3211
Level 49 : Master Engineer
39

Create an account or sign in to comment.

14

1
12/25/2014 9:22 pm
Level 49 : Master Engineer
hokage3211
hokage3211's Avatar
Just as a final update, you guys can check out the project on my user page, just click my name, hopefully you all like it? Again thank you for the support.
1
12/21/2014 1:16 pm
Level 49 : Master Engineer
hokage3211
hokage3211's Avatar
the video is rending in my computer, then I will upload it and put it up here, hopefully you guys like it?
1
12/19/2014 1:11 am
Level 49 : Master Engineer
hokage3211
hokage3211's Avatar
So far, I think it is done, now all I need is some sort of server to set it up in but I don't have the capability to do that on my own, and I also need to make a video explaining it, but if anyone has any ideas I'm still up to hear them.
1
12/16/2014 8:13 pm
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
The "unable to execute" message usually means the command it executed failed for some reason, but this doesn't seem to be the case since it worked when you typed it in the chat. Check the time stamp at the beginning of the command block's error message, it may be possible that the command block is not on the clock for some reason, or is being powered by something else at the same time.
1
12/16/2014 8:22 pm
Level 49 : Master Engineer
hokage3211
hokage3211's Avatar
Thank you, somehow your post caused me to unconsciously fix the error.

It was actually making the command go off repeatedly, but the apparent difficulty seemed to be a single space somehow that worked when typed into the player console, well that is when the player is on top of it, the working command now is:
/execute @a ~ ~ ~ testforblocks -149 82 131 -149 82 131 ~ ~-1 ~
if anyone has any new ideas, I'd still love to hear them though.
1
12/15/2014 11:01 pm
Level 49 : Master Engineer
hokage3211
hokage3211's Avatar
Upon closer inspection, it appears that executing testforblocks as a player results in the same problem, it says "unable to execute" when run in a comment block, but if I put it in chat it says a confirmed message, they are both run when the player is on top of the dropper that needs to be compared, so it's not that the player is in the wrong spot.

command:
/execute @a ~ ~ ~ testforblocks -149 82 131 -149 82 131 ~ ~-1 ~
1
12/15/2014 8:42 pm
Level 49 : Master Engineer
hokage3211
hokage3211's Avatar
Jmal116]
the c= thing sets the max number of entities affected. In this case, it will only change 1 score at a time.


Ah, okay, thank you very much.
1
12/15/2014 8:39 pm
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
hokage3211
This is a good idea, but this might bee too many commands, like you said, if too many people start setting them up, and I want this to be fairly efficient, I will keep this idea in mind though, it is very original, but I do have one question, in the first command, on @e, what does "c=1" mean for the entity? I think I might have heard it once before but I forgot and am too lazy to look it up and search for a few minutes.

the c= thing sets the max number of entities affected. In this case, it will only change 1 score at a time.
1
12/15/2014 8:38 pm
Level 49 : Master Engineer
hokage3211
hokage3211's Avatar
Jmal116Well this certainly turned out to be quite a hard one. I came up with an answer that would probably work, but it's not exactly pretty, and depending on how many people are using it at once it might get somewhat annoying. That being said, it wouldn't require the player to do anything special to use it, so no placing item frames or standing in certain spots or anything like that.

The idea here is that you could look at the contents of each dropper one by one, that way you only had to worry about dealing with one armor stand at a time. One way you could do this would be with a scoreboard objective.

Give one armor stand at a time a score of 1 for the objective, then evaluate the contents of the dropper on that armor stand. You can then replace the dropper or whatever it is you're doing currently. After that is done, set the armor stand's score to 2, then repeat the cycle with the next armor stand. If you'd like some commands, here's a little rough layout of what I'm thinking:
Click to reveal
I'm going to call the scoreboard objective "craft".
Run these commands in order on a clock (you may need something slower than a fill clock if you plan on using /testforblocks):
scoreboard players set @e[type=ArmorStand,name=CraftingStand,c=1] craft 1
execute @e[type=ArmorStand,name=CraftingStand,score_craft=1,score_craft_min=1] ~ ~ ~ testforblocks x y z x2 y2 z2 ~ ~1 ~Obviously the coords are for the droppers you wanted to compare, like in the example you gave. This one can be repeated as much as you need.
From here, I'm going to assume that if the two droppers matched, that you plan on simply cloning a dropper with the crafted item in place of the dropper on top of the armor stand.
execute @e[type=ArmorStand,name=CraftingStand,score_craft=1,score_craft_min=1] ~ ~ ~ clone x y z x2 y2 z2 ~ ~1 ~

From there, you'll have to set the armor stand's score to two scoreboard players set @[type=ArmorStand,name=CraftingStand,score_craft=1,score_craft_min=1] craft 2

Then all you have to do is make sure that there is at least 1 armor stand with a score of 0 before looping around. scoreboard players test @e[type=ArmorStand,name=CraftingStand] craft 0 0
If there are, just repeat the loop. If there aren't, that means all of them have already been checked, and need to be reset before the loop restarts. scoreboard players set @e[type=ArmorStand,name=CraftingStand] craft 0(That one only gets triggered if the previous test was false).


Well that turned out longer than expected. Oh well, too late to second guess myself.


This is a good idea, but this might bee too many commands, like you said, if too many people start setting them up, and I want this to be fairly efficient, I will keep this idea in mind though, it is very original, but I do have one question, in the first command, on @e, what does "c=1" mean for the entity? I think I might have heard it once before but I forgot and am too lazy to look it up and search for a few minutes.
1
12/15/2014 8:33 pm
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
Well this certainly turned out to be quite a hard one. I came up with an answer that would probably work, but it's not exactly pretty, and depending on how many people are using it at once it might get somewhat annoying. That being said, it wouldn't require the player to do anything special to use it, so no placing item frames or standing in certain spots or anything like that.

The idea here is that you could look at the contents of each dropper one by one, that way you only had to worry about dealing with one armor stand at a time. One way you could do this would be with a scoreboard objective.

Give one armor stand at a time a score of 1 for the objective, then evaluate the contents of the dropper on that armor stand. You can then replace the dropper or whatever it is you're doing currently. After that is done, set the armor stand's score to 2, then repeat the cycle with the next armor stand. If you'd like some commands, here's a little rough layout of what I'm thinking:
Click to reveal
I'm going to call the scoreboard objective "craft".
Run these commands in order on a clock (you may need something slower than a fill clock if you plan on using /testforblocks):
scoreboard players set @e[type=ArmorStand,name=CraftingStand,score_craft=0,c=1] craft 1
execute @e[type=ArmorStand,name=CraftingStand,score_craft=1,score_craft_min=1] ~ ~ ~ testforblocks x y z x2 y2 z2 ~ ~1 ~Obviously the coords are for the droppers you wanted to compare, like in the example you gave. This one can be repeated as much as you need.
From here, I'm going to assume that if the two droppers matched, that you plan on simply cloning a dropper with the crafted item in place of the dropper on top of the armor stand.
execute @e[type=ArmorStand,name=CraftingStand,score_craft=1,score_craft_min=1] ~ ~ ~ clone x y z x2 y2 z2 ~ ~1 ~

From there, you'll have to set the armor stand's score to two scoreboard players set @[type=ArmorStand,name=CraftingStand,score_craft=1,score_craft_min=1] craft 2

Then all you have to do is make sure that there is at least 1 armor stand with a score of 0 before looping around. scoreboard players test @e[type=ArmorStand,name=CraftingStand] craft 0 0
If there are, just repeat the loop. If there aren't, that means all of them have already been checked, and need to be reset before the loop restarts. scoreboard players set @e[type=ArmorStand,name=CraftingStand] craft 0(That one only gets triggered if the previous test was false).


Well that turned out longer than expected. Oh well, too late to second guess myself.

EDIT corrected a command so it would actually work.
1
12/15/2014 8:15 pm
Level 9 : Apprentice Engineer
HawkpathAS
HawkpathAS's Avatar
Hey! I'd love to help you out. I was trying to make something like this a while ago as a test but wasn't able to get it to work. I'm a bit busy at the moment, but I just wanted to let you know that I'll try to get something for you soon.
1
12/15/2014 8:22 pm
Level 49 : Master Engineer
hokage3211
hokage3211's Avatar
I'm glad to hear that! For my system I have ideas for it to work entirely in multiplayer and I beleive the issue above is the only difficulty left, and I will make sure to make this completely explainable for people who want to make their own, and I welcome your help as well as anyone else who wants to experiment with this
1
12/15/2014 7:41 pm
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
I'm having a bit of trouble trying to figure out what your issue is, are you simply trying to detect when an armor stand name CraftingStand is directly below a dropper, and then execute a command from it? If so, then you can simply use the detect argument on the /execute command: execute @e[type=ArmorStand,name=CraftingStand] ~ ~ ~ detect ~ ~1 ~ dropper -1 <command>If you run this command on a clock, then whatever you put in instead of <command> will be executed by any and all armor stands with that name directly below a dropper.
1
12/15/2014 7:49 pm
Level 49 : Master Engineer
hokage3211
hokage3211's Avatar
No the dropper is something that has certain items in it in certain positions like actual crafting, and since I want it to be modular I'd rather it do it as a comparing blocks rather than whatever the data tags or data values could test for
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome