Skip to content
This repository was archived by the owner on Jun 1, 2024. It is now read-only.

Entity Body

GamerCoder edited this page Jan 20, 2023 · 1 revision

The EntityBody interface is how you can modify an Entity's metadata, not available in the Spigot API.

import me.gamercoder215.mobchip.EntityBody;
import me.gamercoder215.mobchip.EntityBrain;
import me.gamercoder215.mobchip.bukkit.BukkitBrain;

public class MyPlugin extends JavaPlugin {

   public static void editBody(Mob m) {
       EntityBrain brain = BukkitBrain.getBrain(m);
       EntityBody body = brain.getBody();

       // Sets whether the entity's movement should be amplified while naturally traveling
       body.setDiscardFriction(true);

       if (body.hasVerticalCollision()) {
           // do something...
       }

       // Set vanilla default drops
       body.setDefaultDrops(Material.APPLE, Material.CARROT, Material.DIAMOND);

       // Makes this entity riptide for 5 seconds (100 ticks)
       body.setRiptideTicks(100);
   }
}

Clone this wiki locally