Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey,

I'm trying to make an animated player model using GeckoLib. For that, the player has to implement the interface "IAnimatable". How do I overwrite the player class so I can implement it?ย 
This is what I've tried

package me.cirex.titans.entity;

import com.mojang.authlib.GameProfile;

import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import software.bernie.geckolib3.core.IAnimatable;
import software.bernie.geckolib3.core.manager.AnimationData;
import software.bernie.geckolib3.core.manager.AnimationFactory;

public class CustomPlayerEntity extends PlayerEntity implements IAnimatable {

	public CustomPlayerEntity(World p_i241920_1_, BlockPos p_i241920_2_, float p_i241920_3_, GameProfile p_i241920_4_) {
		super(p_i241920_1_, p_i241920_2_, p_i241920_3_, p_i241920_4_);
		System.out.println("Player was created");
	}

	@Override
	public boolean isSpectator() {
		return false;
	}

	@Override
	public boolean isCreative() {
		return false;
	}

	@Override
	public void tick() {
		System.out.println("test");
		super.tick();
	}

	@Override
	public void registerControllers(AnimationData data) {
		
	}

	@Override
	public AnimationFactory getFactory() {
		return null;
	}

}
package me.cirex.titans.registry;

import me.cirex.titans.entity.CustomPlayerEntity;
import net.minecraft.entity.EntityClassification;
import net.minecraft.entity.EntityType;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;

public class TitanRegistry {

	public static final EntityType<?> playerType = EntityType.Builder
			.<CustomPlayerEntity>create(EntityClassification.MISC).disableSerialization().disableSummoning()
			.size(0.6F, 1.8F).trackingRange(32).func_233608_b_(2).build("minecraft:player").setRegistryName("minecraft:player");

	@SubscribeEvent
	public void onRegisterEntity(RegistryEvent.Register<EntityType<?>> event) {
		if(event.getName().getPath().equalsIgnoreCase("player")) {
			event.setCanceled(true);
		}
		
		event.getRegistry().register(playerType);
	}

}

ย 

  • Author
3 hours ago, diesieben07 said:

You cannot.

ย 

If this is true, report this bug to the library authors. They should be using capabilities.

Okay, thank you

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.