6

Im making a fun survival server in which the player has to keep adding items to the generator, or else the item dropper will lose power. This item dropper drops items needed to power the generator, and the only way to get regen is from potions dropped by dropper. I want to know if there is a way to make a random item from a list drop every so often in the air. The exact spot is -1181 32 -131 in case that helps, Thx.

EDIT I have tried to use an execute command for an armor stand, an invisible guy with his name visibly being ITEM DROP ZONE. this is the command for him: `

/summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,PersistenceRequired:1b,NoGravity:1b,CustomName:"ITEM DROP ZONE",CustomNameVisible:1b}

This shouldn't really change anything for an execute except the @e[type=.... stuff, but I need help with that part. How do I make 1) A chain of commands that allows me to do a random command out of like, lets say, 8 different commands I already have, and 2) a command to have as my guideline, like the working version of /execute @e[type=armor stand, name= ITEM DROP ZONE] /summon Dropped Item.... etc.

  • 1
    Have you made any attempt to solve this yourself? Arqade works better when askers show effort to solve their own problems; we see that you have a problem you've worked on, and answerers respond to that. You also get a more specific answer that's tailored exactly to the part you're stuck, and Arqade gets a very specific question. Everybody wins! – Frank Jan 21 '18 at 20:12
  • 1
    Yes, I have tried but not much in game as I dont have much experience with newer command systems and I cant find anything online. Ive had a long fruitless search. – Mr________ Jan 21 '18 at 20:15
  • Also it would help if it acted like on the Hypixel server's BedWars games forge. – Mr________ Jan 21 '18 at 20:16
  • So if you've tried, then please show us some of the things you've tried. Show us why they don't work, so we know how you're trying to go about it. – Frank Jan 21 '18 at 21:34
  • done (: Ive had mostly syntax trouble with the execute command, but the wiki is just confusing me more XD – Mr________ Jan 22 '18 at 12:26
2

You can create a loot table that contains all the different items you want the item dropper to drop.

Go to minecraft.tools/en/loots.php to create a loot table with all of the items you want in it. Because loot tables are random (you don’t get the same exact drops and amounts of those drops when you kill mobs), loot tables can be used to generate random drops, but can be controlled enough to decide probabilities and amounts if you so desire.

If you don’t know how to create loot tables, there are plenty of examples on the internet that explain how.

Once you create your loot table, copy it to your clipboard and go to your world saves folder (the world saves folder’s name is default to “world” on servers) and then navigate to the folder called data. Create a folder called loot_tables inside of it if it doesn’t already exist. Inside of that folder, create a folder called custom_drops. Inside of the custom_drops folder, create a folder called entities. Then in that folder create a text file called item_dropper.json with your loot table pasted inside of it.

In your minecraft world, use this command to summon the armor stand:

/summon armor_stand -1181 32 -131 {Invisible:1b,Invulnerable:1b,PersistenceRequired:1b,NoGravity:1b,CustomName:"item_dropper",CustomNameVisible:0b,DeathLootTable:”custom_drops:entities/item_dropper”}

Then kill the armor stand with the command /kill @e[type=armor_stand,name=item_dropper] right after you summon it (with chain command blocks you could do this on the same tick).

This will summon an armor stand with the loot table created, and then kill it to make it drop the items in the loot table.

Keep in mind that the mob loot gamerule must be on for this to work. Use /gamerule doMobLoot true to toggle mob loot to true.

0

My first idea would to build a few redstone randomizers that run from a clock, activated by a command block that tests to see if there is power (are potions) in the generator, and every so often the clock will activate, and the randomizers would activate a random command block that spawns in an item at the spot. You can look up a tutorial on how to make a redstone randomizer, and it should be pretty straight forward from there. But as for a command block chain, I couldn't tell you, I do not know much about command blocks. If you need it to be a command block chain, might have to wait for another answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.