Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package educationalpurposes.blocks.crop;
- import java.util.Random;
- import net.minecraft.block.BlockCrops;
- import net.minecraft.world.World;
- public class MyCrop extends BlockCrops
- {
- public MyCrop(int ID)
- {
- super(ID);
- this.setTickRandomly(true);
- }
- @Override
- public void updateTick(World world, int x, int y, int z, Random random)
- {
- // Im not quite sure why you only would want this to get done on the server side
- // Since we need the visual as well?
- if(world.provider.dimensionId != 0)
- {
- this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), this.blockID);
- world.setBlockToAir(x, y, z);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement