Farm Protection for MC 1.16 1.0.0

Prevent players and mobs from destroying farms / farmland!

  1. TaskID
    Native Minecraft Version:
    1.16
    Tested Minecraft Versions:
    • 1.16
    FarmProtection for MC 1.16
    This is a simple plugin to prevent players and mobs from destroying farm / farmland by walking or jumping on it.

    Tested on 1.16.4 and 1.16.5, should work for lower 1.16 versions too.

    If you just want to know how it's working to use it in your own plugins, here's the code.
    Code (Java):
    import org.bukkit.Material;

    import org.bukkit.block.Block;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.Action;
    import org.bukkit.event.entity.EntityInteractEvent;
    import org.bukkit.event.player.PlayerInteractEvent;

    public class FarmProtectionListener implements Listener {

        @EventHandler
        public void onEntityInteract(EntityInteractEvent event) {
            Block block = event.getBlock();
            if(block != null && block.getType() == Material.FARMLAND) {
                event.setCancelled(true);
            }
        }

        @EventHandler
        public void onPlayerInteract(PlayerInteractEvent event) {
            if(event.getAction() == Action.PHYSICAL) {
                if(event.getClickedBlock().getType() == Material.FARMLAND) {
                    event.setCancelled(true);
                }
            }
        }

    }

Recent Reviews

  1. DanTheTechMan
    DanTheTechMan
    5/5,
    Version: 1.0.0
    This is an awesome idea! Thanks for making this plugin :) This was requested on my server so I have decided to install it.
  2. Fixme
    Fixme
    4/5,
    Version: 1.0.0
    SO BEATIFULLLLLLLL PLUGINNNN OMFFFFFFGGGGGGGGGGGGGGGGGGG

    PLEASE TAKEEEEEEEE DOWNLOAD IT FOR THE MAIXIUMUM FUN!!!!!!!!!

    TASKS ARE PRETTEY BOY SO <S3 SO SWWEEETT LOEVEEEEEEEEEEEEEEEEEEEE
    1. TaskID
  3. Jessica123
    Jessica123
    5/5,
    Version: 1.0.0
    so beautiful PLUGIIIN OMFG..

    PLEASE DOWNLOAD IT FOR THE MAXIMUM FUN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    TASKID IS A PRETTY BOY :o SO SWEET <3
    1. TaskID