This repository was archived by the owner on Jun 1, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
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);
}
}Copyright © 2022-Present gmitch215. All Rights Reserved.
Licensed under GNU General Public License v3.0.