Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import software.bernie.geckolib.entity.IAnimatedEntity;
- import software.bernie.geckolib.animation.builder.AnimationBuilder;
- import net.minecraft.entity.Entity;
- import net.mcreator.test.TestModElements;
- import java.util.Map;
- @TestModElements.ModElement.Tag
- public class TadfProcedure extends TestModElements.ModElement {
- public TadfProcedure(TestModElements instance) {
- super(instance, 3);
- }
- public static void executeProcedure(Map<String, Object> dependencies) {
- if (dependencies.get("entity") == null) {
- if (!dependencies.containsKey("entity"))
- System.err.println("Failed to load dependency entity for procedure Tadf!");
- return;
- }
- Entity entity = (Entity) dependencies.get("entity");
- if (entity instanceof IAnimatedEntity) {
- new Object() {
- void playAnimation(Entity entity, String animationID) {
- IAnimatedEntity aniEntity = (IAnimatedEntity) entity;
- aniEntity.getAnimationManager().get("controller").setAnimation(new AnimationBuilder().addAnimation(animationID, (false)));
- }
- }.playAnimation(entity, "animation.rockettier1.fly");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment