Posted November 6, 20222 yr Item Spoiler public class artem extends Item implements IAnimatable, ISyncable { private static final String CONTROLLER_NAME = "popupController"; private static final int ANIM_OPEN = 0; public AnimationFactory factory = GeckoLibUtil.createFactory(this); public artem(Properties properties) { super(properties.tab(CreativeModeTab.TAB_MISC)); GeckoLibNetwork.registerSyncable(this); } @Override public void initializeClient(Consumer<IClientItemExtensions> consumer) { super.initializeClient(consumer); consumer.accept(new IClientItemExtensions() { private final BlockEntityWithoutLevelRenderer renderer = new artemRender(); @Override public BlockEntityWithoutLevelRenderer getCustomRenderer() { return renderer; } }); } private <P extends Item & IAnimatable> PlayState predicate(AnimationEvent<P> event) { // Not setting an animation here as that's handled below return PlayState.CONTINUE; } @Override public void registerControllers(AnimationData data) { AnimationController controller = new AnimationController(this, CONTROLLER_NAME, 20, this::predicate); // Registering a sound listener just makes it so when any sound keyframe is hit // the method will be called. // To register a particle listener or custom event listener you do the exact // same thing, just with registerParticleListener and // registerCustomInstructionListener, respectively. controller.registerSoundListener(this::soundListener); data.addAnimationController(controller); } private <ENTITY extends IAnimatable> void soundListener(SoundKeyframeEvent<ENTITY> event) { // The animation for the JackInTheBoxItem has a sound keyframe at time 0:00. // As soon as that keyframe gets hit this method fires and it starts playing the // sound to the current player. // The music is synced with the animation so the box opens as soon as the music // plays the box opening sound LocalPlayer player = Minecraft.getInstance().player; if (player != null) { } } @Override public AnimationFactory getFactory() { return this.factory; } @Override public InteractionResultHolder<ItemStack> use(Level world, Player player, InteractionHand hand) { if (!world.isClientSide) { // Gets the item that the player is holding, should be a JackInTheBoxItem final ItemStack stack = player.getItemInHand(hand); final int id = GeckoLibUtil.guaranteeIDForStack(stack, (ServerLevel) world); // Tell all nearby clients to trigger this JackInTheBoxItem final PacketDistributor.PacketTarget target = PacketDistributor.TRACKING_ENTITY_AND_SELF.with(() -> player); GeckoLibNetwork.syncAnimation(target, this, id, ANIM_OPEN); } return super.use(world, player, hand); } @Override public void onAnimationSync(int id, int state) { if (state == ANIM_OPEN) { // Always use GeckoLibUtil to get AnimationControllers when you don't have // access to an AnimationEvent final AnimationController controller = GeckoLibUtil.getControllerForID(this.factory, id, CONTROLLER_NAME); if (controller.getAnimationState() == AnimationState.Stopped) { final LocalPlayer player = Minecraft.getInstance().player; if (player != null) { player.displayClientMessage(Component.literal("Opening the jack in the box!"), true); } // If you don't do this, the popup animation will only play once because the // animation will be cached. controller.markNeedsReload(); // Set the animation to open the JackInTheBoxItem which will start playing music // and // eventually do the actual animation. Also sets it to not loop controller.setAnimation(new AnimationBuilder().addAnimation("Soaryn_chest_popup", EDefaultLoopTypes.PLAY_ONCE)); } } } } model Spoiler public class artemModel extends AnimatedGeoModel<artem> { public static final ResourceLocation JACKINTHEBOX_MODEL = new ResourceLocation(ExampleMod.MODID, "geo/pistol.geo.json"); public static final ResourceLocation JACKINTHEBOX_TEXTURE = new ResourceLocation(ExampleMod.MODID, "textures/item/pistol.png"); public static final ResourceLocation JACKINTHEBOX_ANIMATIONS = new ResourceLocation(ExampleMod.MODID, "animations/pistol.animation.json"); @Override public ResourceLocation getModelResource(artem object) { return JACKINTHEBOX_MODEL; } @Override public ResourceLocation getTextureResource(artem object) { return JACKINTHEBOX_TEXTURE; } @Override public ResourceLocation getAnimationResource(artem animatable) { return JACKINTHEBOX_ANIMATIONS; } } render Spoiler public class artemRender extends GeoItemRenderer<artem> { public artemRender() { super(new artemModel()); } } Item reg Spoiler public class items { public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ExampleMod.MODID); public static final RegistryObject<artem> ARTEM = ITEMS.register("artem", () -> new artem(new Item.Properties())); } Main class Spoiler @Mod(ExampleMod.MODID) public class ExampleMod { public ExampleMod() { GeckoLib.initialize(); IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); items.ITEMS.register(modEventBus); ... ... } geo model json Spoiler { "format_version": "1.12.0", "minecraft:geometry": [ { "description": { "identifier": "geometry.unknown", "texture_width": 64, "texture_height": 64, "visible_bounds_width": 3, "visible_bounds_height": 2.5, "visible_bounds_offset": [0, 0.75, 0] }, "bones": [ { "name": "group", "pivot": [-0.49601, 4.03502, -0.09665], "cubes": [ { "origin": [-2, -0.25, -9.25], "size": [3, 4, 7.75], "uv": { "north": {"uv": [30, 18], "uv_size": [3, 4]}, "east": {"uv": [14, 12], "uv_size": [8, 4]}, "south": {"uv": [25, 30], "uv_size": [3, 4]}, "west": {"uv": [14, 16], "uv_size": [8, 4]}, "up": {"uv": [5, 19], "uv_size": [3, 8]}, "down": {"uv": [19, 28], "uv_size": [3, -8]} } }, { "origin": [-1.375, 1.25, -11.75], "size": [1.75, 2.5, 4.25], "uv": { "north": {"uv": [37, 6], "uv_size": [2, 3]}, "east": {"uv": [30, 26], "uv_size": [4, 3]}, "south": {"uv": [16, 37], "uv_size": [2, 3]}, "west": {"uv": [28, 30], "uv_size": [4, 3]}, "up": {"uv": [17, 29], "uv_size": [2, 4]}, "down": {"uv": [3, 40], "uv_size": [2, -4]} } }, { "origin": [-2.125, 2, -2.875], "size": [3.25, 1.5, 2.75], "pivot": [-0.5, 2.25, -2.5], "rotation": [45, 0, 0], "uv": { "north": {"uv": [27, 4], "uv_size": [3, 2]}, "east": {"uv": [37, 18], "uv_size": [3, 2]}, "south": {"uv": [37, 20], "uv_size": [3, 2]}, "west": {"uv": [37, 22], "uv_size": [3, 2]}, "up": {"uv": [32, 33], "uv_size": [3, 3]}, "down": {"uv": [34, 9], "uv_size": [3, -3]} } }, { "origin": [-2.25, 3.75, -12], "size": [3.5, 3, 18.5], "uv": { "north": {"uv": [31, 0], "uv_size": [4, 3]}, "east": {"uv": [8, 0], "uv_size": [19, 3]}, "south": {"uv": [31, 3], "uv_size": [4, 3]}, "west": {"uv": [8, 3], "uv_size": [19, 3]}, "up": {"uv": [0, 0], "uv_size": [4, 19]}, "down": {"uv": [4, 19], "uv_size": [4, -19]} } }, { "origin": [-1.875, 4.75, -11.875], "size": [2.75, 3, 18.25], "uv": { "north": {"uv": [14, 34], "uv_size": [3, 3]}, "east": {"uv": [8, 6], "uv_size": [18, 3]}, "south": {"uv": [34, 21], "uv_size": [3, 3]}, "west": {"uv": [8, 9], "uv_size": [18, 3]}, "up": {"uv": [8, 12], "uv_size": [3, 18]}, "down": {"uv": [11, 30], "uv_size": [3, -18]} } }, { "origin": [-2.125, -2.89866, 3.40497], "size": [3.25, 4.5, 3.5], "pivot": [-0.5, 0.57009, 6.21747], "rotation": [22.5, 0, 0], "uv": { "north": {"uv": [5, 27], "uv_size": [3, 5]}, "east": {"uv": [22, 12], "uv_size": [4, 5]}, "south": {"uv": [19, 28], "uv_size": [3, 5]}, "west": {"uv": [22, 17], "uv_size": [4, 5]}, "up": {"uv": [31, 6], "uv_size": [3, 4]}, "down": {"uv": [31, 26], "uv_size": [3, -4]} } }, { "origin": [-2, -5.46979, 4.98488], "size": [3, 3.125, 3.125], "uv": { "north": {"uv": [34, 24], "uv_size": [3, 3]}, "east": {"uv": [25, 34], "uv_size": [3, 3]}, "south": {"uv": [35, 0], "uv_size": [3, 3]}, "west": {"uv": [35, 3], "uv_size": [3, 3]}, "up": {"uv": [8, 35], "uv_size": [3, 3]}, "down": {"uv": [35, 12], "uv_size": [3, -3]} } }, { "origin": [-2, 0.47634, 3.27997], "size": [3, 4.125, 3.125], "uv": { "north": {"uv": [0, 32], "uv_size": [3, 4]}, "east": {"uv": [3, 32], "uv_size": [3, 4]}, "south": {"uv": [32, 29], "uv_size": [3, 4]}, "west": {"uv": [17, 33], "uv_size": [3, 4]}, "up": {"uv": [11, 35], "uv_size": [3, 3]}, "down": {"uv": [35, 15], "uv_size": [3, -3]} } }, { "origin": [-1.75, -2.64866, 2.65497], "size": [2.5, 4.75, 4.75], "pivot": [-0.5, 0.57009, 6.21747], "rotation": [22.5, 0, 0], "uv": { "north": {"uv": [14, 29], "uv_size": [3, 5]}, "east": {"uv": [0, 19], "uv_size": [5, 5]}, "south": {"uv": [8, 30], "uv_size": [3, 5]}, "west": {"uv": [14, 20], "uv_size": [5, 5]}, "up": {"uv": [11, 30], "uv_size": [3, 5]}, "down": {"uv": [22, 35], "uv_size": [3, -5]} } }, { "origin": [-1.625, -4.96979, 4.23488], "size": [2.25, 3.125, 4.25], "uv": { "north": {"uv": [18, 37], "uv_size": [2, 3]}, "east": {"uv": [33, 18], "uv_size": [4, 3]}, "south": {"uv": [37, 24], "uv_size": [2, 3]}, "west": {"uv": [28, 33], "uv_size": [4, 3]}, "up": {"uv": [36, 27], "uv_size": [2, 4]}, "down": {"uv": [28, 40], "uv_size": [2, -4]} } }, { "origin": [-1.625, 0.60134, 2.40497], "size": [2.25, 4, 4.375], "uv": { "north": {"uv": [30, 36], "uv_size": [2, 4]}, "east": {"uv": [26, 18], "uv_size": [4, 4]}, "south": {"uv": [36, 31], "uv_size": [2, 4]}, "west": {"uv": [22, 26], "uv_size": [4, 4]}, "up": {"uv": [32, 36], "uv_size": [2, 4]}, "down": {"uv": [34, 40], "uv_size": [2, -4]} } }, { "origin": [-1.5, 0.875, -1.5], "size": [2, 0.5, 6], "uv": { "north": {"uv": [30, 29], "uv_size": [2, 1]}, "east": {"uv": [38, 0], "uv_size": [6, 1]}, "south": {"uv": [40, 21], "uv_size": [2, 1]}, "west": {"uv": [38, 1], "uv_size": [6, 1]}, "up": {"uv": [6, 32], "uv_size": [2, 6]}, "down": {"uv": [20, 39], "uv_size": [2, -6]} } }, { "origin": [-2, 3.875, 4.5], "size": [3, 1, 3], "uv": { "north": {"uv": [39, 38], "uv_size": [3, 1]}, "east": {"uv": [40, 4], "uv_size": [3, 1]}, "south": {"uv": [40, 10], "uv_size": [3, 1]}, "west": {"uv": [40, 11], "uv_size": [3, 1]}, "up": {"uv": [35, 15], "uv_size": [3, 3]}, "down": {"uv": [22, 38], "uv_size": [3, -3]} } }, { "origin": [-1.625, 4, 7.5], "size": [2.25, 0.75, 2], "uv": { "north": {"uv": [40, 22], "uv_size": [2, 1]}, "east": {"uv": [40, 23], "uv_size": [2, 1]}, "south": {"uv": [25, 40], "uv_size": [2, 1]}, "west": {"uv": [28, 40], "uv_size": [2, 1]}, "up": {"uv": [8, 38], "uv_size": [2, 2]}, "down": {"uv": [38, 11], "uv_size": [2, -2]} } }, { "origin": [1, 0.625, -7.5], "size": [0.5, 4.125, 5], "uv": { "north": {"uv": [4, 28], "uv_size": [1, 4]}, "east": {"uv": [22, 22], "uv_size": [5, 4]}, "south": {"uv": [10, 38], "uv_size": [1, 4]}, "west": {"uv": [0, 24], "uv_size": [5, 4]}, "up": {"uv": [5, 36], "uv_size": [1, 5]}, "down": {"uv": [27, 42], "uv_size": [1, -5]} } }, { "origin": [-2.5, 0.625, -7.5], "size": [0.5, 4.125, 5], "uv": { "north": {"uv": [11, 38], "uv_size": [1, 4]}, "east": {"uv": [14, 25], "uv_size": [5, 4]}, "south": {"uv": [38, 11], "uv_size": [1, 4]}, "west": {"uv": [26, 6], "uv_size": [5, 4]}, "up": {"uv": [6, 38], "uv_size": [1, 5]}, "down": {"uv": [7, 43], "uv_size": [1, -5]} } }, { "origin": [1.25, 4.625, -10], "size": [0.75, 1.75, 9], "uv": { "north": {"uv": [30, 4], "uv_size": [1, 2]}, "east": {"uv": [26, 10], "uv_size": [9, 2]}, "south": {"uv": [34, 27], "uv_size": [1, 2]}, "west": {"uv": [26, 12], "uv_size": [9, 2]}, "up": {"uv": [35, 27], "uv_size": [1, 9]}, "down": {"uv": [0, 45], "uv_size": [1, -9]} } }, { "origin": [-2.875, 4.625, -10], "size": [0.625, 1.75, 9], "uv": { "north": {"uv": [19, 40], "uv_size": [1, 2]}, "east": {"uv": [26, 14], "uv_size": [9, 2]}, "south": {"uv": [30, 40], "uv_size": [1, 2]}, "west": {"uv": [26, 16], "uv_size": [9, 2]}, "up": {"uv": [1, 36], "uv_size": [1, 9]}, "down": {"uv": [2, 45], "uv_size": [1, -9]} } }, { "origin": [0.375, 2.625, -11.5], "size": [1.375, 3.625, 4], "uv": { "north": {"uv": [12, 38], "uv_size": [1, 4]}, "east": {"uv": [26, 26], "uv_size": [4, 4]}, "south": {"uv": [13, 38], "uv_size": [1, 4]}, "west": {"uv": [27, 0], "uv_size": [4, 4]}, "up": {"uv": [22, 38], "uv_size": [1, 4]}, "down": {"uv": [23, 42], "uv_size": [1, -4]} } }, { "origin": [-2.75, 2.625, -11.5], "size": [1.375, 3.625, 4], "uv": { "north": {"uv": [24, 38], "uv_size": [1, 4]}, "east": {"uv": [27, 22], "uv_size": [4, 4]}, "south": {"uv": [38, 27], "uv_size": [1, 4]}, "west": {"uv": [0, 28], "uv_size": [4, 4]}, "up": {"uv": [38, 31], "uv_size": [1, 4]}, "down": {"uv": [38, 39], "uv_size": [1, -4]} } }, { "origin": [-3.5, -0.125, -5.875], "size": [1.5, 0.75, 4], "uv": { "north": {"uv": [31, 40], "uv_size": [2, 1]}, "east": {"uv": [38, 5], "uv_size": [4, 1]}, "south": {"uv": [33, 40], "uv_size": [2, 1]}, "west": {"uv": [38, 15], "uv_size": [4, 1]}, "up": {"uv": [36, 35], "uv_size": [2, 4]}, "down": {"uv": [14, 41], "uv_size": [2, -4]} } }, { "origin": [-0.75, -0.875, -7.5], "size": [0.5, 0.625, 4], "uv": { "north": {"uv": [33, 21], "uv_size": [1, 1]}, "east": {"uv": [38, 16], "uv_size": [4, 1]}, "south": {"uv": [34, 9], "uv_size": [1, 1]}, "west": {"uv": [38, 17], "uv_size": [4, 1]}, "up": {"uv": [39, 11], "uv_size": [1, 4]}, "down": {"uv": [20, 43], "uv_size": [1, -4]} } }, { "origin": [-1.25, 1.125, 6.5], "size": [1.5, 2.875, 0.75], "pivot": [-0.5, 2.5625, 6.875], "rotation": [22.5, 0, 0], "uv": { "north": {"uv": [25, 37], "uv_size": [2, 3]}, "east": {"uv": [21, 39], "uv_size": [1, 3]}, "south": {"uv": [38, 2], "uv_size": [2, 3]}, "west": {"uv": [40, 12], "uv_size": [1, 3]}, "up": {"uv": [40, 39], "uv_size": [2, 1]}, "down": {"uv": [40, 41], "uv_size": [2, -1]} } }, { "origin": [-0.625, 1.40248, 1.84024], "size": [0.25, 2.875, 0.625], "pivot": [-0.5, 3.08998, 2.02774], "rotation": [-45, 0, 0], "uv": { "north": {"uv": [16, 40], "uv_size": [1, 3]}, "east": {"uv": [17, 40], "uv_size": [1, 3]}, "south": {"uv": [18, 40], "uv_size": [1, 3]}, "west": {"uv": [40, 18], "uv_size": [1, 3]}, "up": {"uv": [39, 8], "uv_size": [1, 1]}, "down": {"uv": [42, 24], "uv_size": [1, -1]} } }, { "origin": [-0.75, 2.52748, 1.46524], "size": [0.5, 1.75, 1], "pivot": [-0.5, 3.08998, 2.02774], "rotation": [-22.5, 0, 0], "uv": { "north": {"uv": [35, 40], "uv_size": [1, 2]}, "east": {"uv": [5, 41], "uv_size": [1, 2]}, "south": {"uv": [41, 6], "uv_size": [1, 2]}, "west": {"uv": [41, 12], "uv_size": [1, 2]}, "up": {"uv": [24, 42], "uv_size": [1, 1]}, "down": {"uv": [42, 26], "uv_size": [1, -1]} } }, { "origin": [-1.375, 7.75, 4.5], "size": [1.75, 0.375, 1.875], "uv": { "north": {"uv": [14, 41], "uv_size": [2, 1]}, "east": {"uv": [41, 14], "uv_size": [2, 1]}, "south": {"uv": [41, 18], "uv_size": [2, 1]}, "west": {"uv": [41, 19], "uv_size": [2, 1]}, "up": {"uv": [39, 6], "uv_size": [2, 2]}, "down": {"uv": [39, 26], "uv_size": [2, -2]} } }, { "origin": [0.125, 8.125, 4.5], "size": [0.25, 0.375, 1.875], "uv": { "north": {"uv": [42, 26], "uv_size": [1, 1]}, "east": {"uv": [41, 20], "uv_size": [2, 1]}, "south": {"uv": [27, 42], "uv_size": [1, 1]}, "west": {"uv": [41, 24], "uv_size": [2, 1]}, "up": {"uv": [25, 41], "uv_size": [1, 2]}, "down": {"uv": [41, 27], "uv_size": [1, -2]} } }, { "origin": [1.25, 4.825, 4], "size": [0.25, 0.875, 1.5], "uv": { "north": {"uv": [28, 42], "uv_size": [1, 1]}, "east": {"uv": [41, 27], "uv_size": [2, 1]}, "south": {"uv": [42, 28], "uv_size": [1, 1]}, "west": {"uv": [28, 41], "uv_size": [2, 1]}, "up": {"uv": [26, 41], "uv_size": [1, 2]}, "down": {"uv": [41, 30], "uv_size": [1, -2]} } }, { "origin": [-2.5, 4.825, 4], "size": [0.25, 0.875, 1.5], "uv": { "north": {"uv": [29, 42], "uv_size": [1, 1]}, "east": {"uv": [41, 30], "uv_size": [2, 1]}, "south": {"uv": [42, 29], "uv_size": [1, 1]}, "west": {"uv": [31, 41], "uv_size": [2, 1]}, "up": {"uv": [41, 31], "uv_size": [1, 2]}, "down": {"uv": [33, 43], "uv_size": [1, -2]} } }, { "origin": [1.25, 4.825, 5.5], "size": [0.625, 0.875, 0.875], "uv": { "north": {"uv": [30, 42], "uv_size": [1, 1]}, "east": {"uv": [31, 42], "uv_size": [1, 1]}, "south": {"uv": [42, 31], "uv_size": [1, 1]}, "west": {"uv": [32, 42], "uv_size": [1, 1]}, "up": {"uv": [42, 32], "uv_size": [1, 1]}, "down": {"uv": [35, 43], "uv_size": [1, -1]} } }, { "origin": [-2.875, 4.825, 5.5], "size": [0.625, 0.875, 0.875], "uv": { "north": {"uv": [42, 35], "uv_size": [1, 1]}, "east": {"uv": [42, 36], "uv_size": [1, 1]}, "south": {"uv": [42, 38], "uv_size": [1, 1]}, "west": {"uv": [42, 39], "uv_size": [1, 1]}, "up": {"uv": [42, 40], "uv_size": [1, 1]}, "down": {"uv": [42, 42], "uv_size": [1, -1]} } }, { "origin": [0.125, 8.5, 5], "size": [0.25, 0.375, 1.125], "uv": { "north": {"uv": [42, 42], "uv_size": [1, 1]}, "east": {"uv": [43, 2], "uv_size": [1, 1]}, "south": {"uv": [43, 3], "uv_size": [1, 1]}, "west": {"uv": [43, 4], "uv_size": [1, 1]}, "up": {"uv": [5, 43], "uv_size": [1, 1]}, "down": {"uv": [43, 6], "uv_size": [1, -1]} } }, { "origin": [-1.375, 8.125, 4.5], "size": [0.25, 0.375, 1.875], "uv": { "north": {"uv": [6, 43], "uv_size": [1, 1]}, "east": {"uv": [41, 33], "uv_size": [2, 1]}, "south": {"uv": [43, 6], "uv_size": [1, 1]}, "west": {"uv": [41, 34], "uv_size": [2, 1]}, "up": {"uv": [34, 41], "uv_size": [1, 2]}, "down": {"uv": [41, 37], "uv_size": [1, -2]} } }, { "origin": [-1.375, 8.5, 5], "size": [0.25, 0.375, 1.125], "uv": { "north": {"uv": [7, 43], "uv_size": [1, 1]}, "east": {"uv": [43, 8], "uv_size": [1, 1]}, "south": {"uv": [43, 9], "uv_size": [1, 1]}, "west": {"uv": [43, 10], "uv_size": [1, 1]}, "up": {"uv": [11, 43], "uv_size": [1, 1]}, "down": {"uv": [43, 12], "uv_size": [1, -1]} } }, { "origin": [-0.75, 7.75, -11], "size": [0.5, 0.375, 1.375], "uv": { "north": {"uv": [12, 43], "uv_size": [1, 1]}, "east": {"uv": [13, 43], "uv_size": [1, 1]}, "south": {"uv": [14, 43], "uv_size": [1, 1]}, "west": {"uv": [43, 14], "uv_size": [1, 1]}, "up": {"uv": [16, 43], "uv_size": [1, 1]}, "down": {"uv": [17, 44], "uv_size": [1, -1]} } }, { "origin": [1, 3.375, -14.625], "size": [0.75, 2, 2], "pivot": [13.5, -5.25, -14.5], "rotation": [-45, 0, 0], "uv": { "north": {"uv": [36, 41], "uv_size": [1, 2]}, "east": {"uv": [39, 26], "uv_size": [2, 2]}, "south": {"uv": [37, 41], "uv_size": [1, 2]}, "west": {"uv": [39, 28], "uv_size": [2, 2]}, "up": {"uv": [38, 41], "uv_size": [1, 2]}, "down": {"uv": [39, 43], "uv_size": [1, -2]} } }, { "origin": [-2.75, 3.375, -14.625], "size": [0.75, 2, 2], "pivot": [-13.5, -5.25, -14.5], "rotation": [-45, 0, 0], "uv": { "north": {"uv": [40, 41], "uv_size": [1, 2]}, "east": {"uv": [39, 30], "uv_size": [2, 2]}, "south": {"uv": [41, 41], "uv_size": [1, 2]}, "west": {"uv": [39, 32], "uv_size": [2, 2]}, "up": {"uv": [42, 2], "uv_size": [1, 2]}, "down": {"uv": [3, 44], "uv_size": [1, -2]} } }, { "origin": [1.75, 3.875, -14.125], "size": [0.25, 1, 1], "pivot": [13.5, -5.25, -14.5], "rotation": [-45, 0, 0], "uv": { "north": {"uv": [18, 43], "uv_size": [1, 1]}, "east": {"uv": [43, 18], "uv_size": [1, 1]}, "south": {"uv": [43, 19], "uv_size": [1, 1]}, "west": {"uv": [20, 43], "uv_size": [1, 1]}, "up": {"uv": [43, 20], "uv_size": [1, 1]}, "down": {"uv": [21, 44], "uv_size": [1, -1]} } }, { "origin": [-3, 3.875, -14.125], "size": [0.25, 1, 1], "pivot": [-13.5, -5.25, -14.5], "rotation": [-45, 0, 0], "uv": { "north": {"uv": [43, 21], "uv_size": [1, 1]}, "east": {"uv": [22, 43], "uv_size": [1, 1]}, "south": {"uv": [43, 22], "uv_size": [1, 1]}, "west": {"uv": [43, 23], "uv_size": [1, 1]}, "up": {"uv": [24, 43], "uv_size": [1, 1]}, "down": {"uv": [43, 25], "uv_size": [1, -1]} } }, { "origin": [-1.5, 4.25, -13.5], "size": [2, 2, 1.5], "pivot": [-0.5, 5.25, -12.75], "rotation": [0, 0, -45], "uv": { "north": {"uv": [39, 34], "uv_size": [2, 2]}, "east": {"uv": [36, 39], "uv_size": [2, 2]}, "south": {"uv": [39, 36], "uv_size": [2, 2]}, "west": {"uv": [38, 39], "uv_size": [2, 2]}, "up": {"uv": [40, 2], "uv_size": [2, 2]}, "down": {"uv": [3, 42], "uv_size": [2, -2]} } }, { "origin": [-1.5, 5.25, 6.375], "size": [2, 2, 0.25], "pivot": [-0.5, 6.25, 7.5], "rotation": [0, 0, 45], "uv": { "north": {"uv": [8, 40], "uv_size": [2, 2]}, "east": {"uv": [4, 42], "uv_size": [1, 2]}, "south": {"uv": [40, 8], "uv_size": [2, 2]}, "west": {"uv": [42, 5], "uv_size": [1, 2]}, "up": {"uv": [41, 37], "uv_size": [2, 1]}, "down": {"uv": [42, 8], "uv_size": [2, -1]} } }, { "origin": [-0.75, 6, 6.625], "size": [0.5, 0.5, 0.125], "pivot": [-0.5, 6.25, 7.5], "rotation": [0, 0, 45], "uv": { "north": {"uv": [25, 43], "uv_size": [1, 1]}, "east": {"uv": [43, 25], "uv_size": [1, 1]}, "south": {"uv": [26, 43], "uv_size": [1, 1]}, "west": {"uv": [43, 26], "uv_size": [1, 1]}, "up": {"uv": [27, 43], "uv_size": [1, 1]}, "down": {"uv": [43, 28], "uv_size": [1, -1]} } }, { "origin": [0.25, 5.375, 6.625], "size": [0.125, 1.75, 0.125], "pivot": [-0.5, 6.25, 7.5], "rotation": [0, 0, 45], "uv": { "north": {"uv": [8, 42], "uv_size": [1, 2]}, "east": {"uv": [42, 8], "uv_size": [1, 2]}, "south": {"uv": [9, 42], "uv_size": [1, 2]}, "west": {"uv": [10, 42], "uv_size": [1, 2]}, "up": {"uv": [28, 43], "uv_size": [1, 1]}, "down": {"uv": [43, 29], "uv_size": [1, -1]} } }, { "origin": [-1.25, 7, 6.625], "size": [1.5, 0.125, 0.125], "pivot": [-0.5, 6.25, 7.5], "rotation": [0, 0, 45], "uv": { "north": {"uv": [11, 42], "uv_size": [2, 1]}, "east": {"uv": [29, 43], "uv_size": [1, 1]}, "south": {"uv": [42, 12], "uv_size": [2, 1]}, "west": {"uv": [43, 29], "uv_size": [1, 1]}, "up": {"uv": [13, 42], "uv_size": [2, 1]}, "down": {"uv": [42, 14], "uv_size": [2, -1]} } }, { "origin": [-1.25, 5.375, 6.625], "size": [1.5, 0.125, 0.125], "pivot": [-0.5, 6.25, 7.5], "rotation": [0, 0, 45], "uv": { "north": {"uv": [42, 15], "uv_size": [2, 1]}, "east": {"uv": [30, 43], "uv_size": [1, 1]}, "south": {"uv": [42, 16], "uv_size": [2, 1]}, "west": {"uv": [43, 30], "uv_size": [1, 1]}, "up": {"uv": [42, 17], "uv_size": [2, 1]}, "down": {"uv": [21, 43], "uv_size": [2, -1]} } }, { "origin": [-1.375, 5.375, 6.625], "size": [0.125, 1.75, 0.125], "pivot": [-0.5, 6.25, 7.5], "rotation": [0, 0, 45], "uv": { "north": {"uv": [15, 42], "uv_size": [1, 2]}, "east": {"uv": [19, 42], "uv_size": [1, 2]}, "south": {"uv": [42, 21], "uv_size": [1, 2]}, "west": {"uv": [23, 42], "uv_size": [1, 2]}, "up": {"uv": [31, 43], "uv_size": [1, 1]}, "down": {"uv": [43, 32], "uv_size": [1, -1]} } } ] } ] } ] } build.gradle Spoiler epositories { maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' } // Put repositories for dependencies here // ForgeGradle automatically adds the Forge maven and Maven Central for you // If you have mod jar dependencies in ./libs, you can declare them as a repository like so: // flatDir { // dir 'libs' // } } dependencies { // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. minecraft 'net.minecraftforge:forge:1.19.2-43.1.47' implementation fg.deobf('software.bernie.geckolib:geckolib-forge-1.19:3.1.36') // Real mod deobf dependency examples - these get remapped to your current mappings // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency // Examples using mod jars from ./libs // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}") // For more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } Instead of a model, a default black and pink square. Forgive me for asking this question here. EDIT: The examples from the mod work great. Edited November 6, 20222 yr by Luckydel
November 6, 20222 yr Look in your run/logs/debug.log You probably have an error about missing textures, models or invalid json there. Failing that, you need to ask geckolib. That mod is responsible for loading the model. Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
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.