ModsJava
SimpleNoCropTrample
[1.7-1.19] A very simple Spigot Plugin that stops players/mobs from trampling crops. Free Minecraft Java mod for 1.7, 1.8, 1.9.
⬇ Download on Spigot
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, ...).
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
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 ( ) + "!" ) ;
}
}
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 ( ) + "!" ) ;
}
}
SimpleNoCropTrample is a free Minecraft Java mod. Compatible with Minecraft 1.7, 1.8, 1.9, 1.10 and newer. Downloaded 5,746 times (via Spigot). Download it and open it directly in the game.