KapitanWalnut

[Vanilla] Make Dispensers plant things

Oct 4th, 2014
2,340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. I'm not going to upload everything, but here's the commands I used for wheat seeds:
  2.  
  3. These commands need to be run only once:
  4.  
  5. /scoreboard objectives add isSeed dummy
  6. /scoreboard objectives add isSeedPlant dummy
  7.  
  8. The rest of the commands all need to be on a 20t/s clock.
  9.  
  10. This command checks to see if the item is a wheat seed and if it wasn't dropped by a player:
  11. /scoreboard players set @e[type=Item] isSeed 1 {Item:{id:minecraft:wheat_seeds},Age:0s,PickupDelay:0s}
  12.  
  13. This command checks to see if there's tilled soil under the seed, and if there is a dispenser next to the seed. This command needs to be duplicated 4 times, with the last set of tildes (~) changed to reflect the different cardinal directions:
  14. /execute @e[score_isSeed_min=1,score_isSeed=1] ~ ~ ~ detect ~ ~-1 ~ farmland -1 execute @e[score_isSeed_min=1,score_isSeed=1] ~ ~ ~ detect ~1 ~ ~ dispenser -1 scoreboard players set @e[score_isSeed_min=1,score_isSeed=1,r=1] isSeedPlant 1
  15.  
  16. This command plants the seeds:
  17. /execute @e[type=Item,score_isSeedPlant_min=1,score_isSeedPlant=1] ~ ~ ~ setblock ~ ~ ~ wheat
  18.  
  19. Finally, this command kills the seed item:
  20. /kill @e[type=Item,score_isSeedPlant_min=1,score_isSeedPlant=1]
Advertisement
Add Comment
Please, Sign In to add comment