How to make a tool automatically plant a crop?

Started by Bball_262 on

Topic category: Help with modding (Java Edition)

Last seen on 16:45, 6. Apr 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a tool automatically plant a crop?

So, I have a procedure, that is meant to check for when you right click a block, if that block is Dirt, Grass, or Farmland, it will either turn it into farmland or leave it alone, then it will plant either carrots or wheat. Only issue is, that when it tries to plant the seed, it just doesn't do anything. Can anyone help out?

Procedure (Shortened bcuz long script):
 

If [block at position x y z] = Grass_Block
do replace block at x y z with Farmland
     set local random = random(0, 1)
     if random = 0
     do place wheat at x y + 1 z
     else if random = 1
     do place carrots at x y + 1 z