SimpleNoCropTrample icon

SimpleNoCropTrample -----

[1.7-1.19] A very simple Spigot Plugin that stops players/mobs from trampling crops.



[​IMG]
A very simple Spigot Plugin that stops players/mobs from trampling crops.

I created this because i wasn't able to find an AntiCropTrample/NoCropTrample plugin, which doesn't have tons of useless features like permissions, commands etc. My plugin doesn't require any configuration, just put it in your plugins folder and you're good to go.

This plugin should work with every version from 1.7-1.19. You can use every spigot based server version (Thermos, Magma, ...).
Config
Code (YAML):
// If true, mobs won't be able to trample crops
disable-mob-trampling
: true

// If true, player won't be able to trample crops
disable-player-trampling
: true

// List of blocks that count as farmland (FARMLAND for 1.13+ and SOIL for <1.13 )
farmlands-blocks
:
- FARMLAND
- SOIL
 

API
This plugin has a simple API that can be used to manipulate crop trampeling for different players/mobs.

You can listen to the CropTrampleEvent and implement your custom logic to add features like permissions or bypasses.

The plugin also uses the event to disable crop trample if the config settings are enabled.

Example
Code (Java):
@EventHandler
public void onTrample (CropTrampleEvent event ) {
    if (event. getCause ( ) == CropTrampleEvent. TrampleCause. PLAYER ) {
       Player player = (Player ) event. getTrampler ( ) ;
       player. sendMessage ( "You're not able to destroy " + event. getBlock ( ). getType ( ) + "!" ) ;
    }
}
TrampleCause can either be MOB or PLAYER, depending on what entity tries to destroy the farmland.

[​IMG]
Resource Information
Author:
----------
Total Downloads: 5,061
First Release: Dec 21, 2019
Last Update: Jan 24, 2022
Category: ---------------
All-Time Rating:
7 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings