Jump to content

Recommended Posts

Posted

(here is the full code for reference)

// Made with Blockbench 3.6.3
// Exported for Minecraft version 1.15
// Paste this class into your mod and generate all required imports


public class custom_model extends BipedModel<LivingEntity> {
   private final ModelRenderer bipedHead;
   private final ModelRenderer bipedHeadwear;
   private final ModelRenderer bipedBody;
   private final ModelRenderer bipedRightLeg;
   private final ModelRenderer bipedLeftLeg;
   private final ModelRenderer bipedLeftArm;
   private final ModelRenderer bipedRightArm;

   public custom_model(float modelSize) {
      super(modelSize, 0.0F, 64, 40);

      ModelRenderer bipedBody = new ModelRenderer(this);
      bipedBody.setRotationPoint(0.0F, 0.0F, 0.0F);
      bipedBody.setTextureOffset(0, 32).addBox(-9.0F, 0.0F, -2.0F, 18.0F, 4.0F, 4.0F, 0.25F, false);

   }

   public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
      modelRenderer.rotateAngleX = x;
      modelRenderer.rotateAngleY = y;
      modelRenderer.rotateAngleZ = z;
   }
}
Posted (edited)
  On 9/16/2020 at 4:26 PM, iSyriux said:

BipedModel extended Living Entity, but when I return it it gives an error

Expand  

That's probably because biped model doesn't extend living entity. You are also interpreting generics backwards. You need a class that is an instance of BipedModel, not the opposite way around.

 

Please take the time to learn java if you haven't already. It will definitely help when doing all this in the future.

Edited by ChampionAsh5357
  • Like 1
Posted
  On 9/16/2020 at 4:26 PM, iSyriux said:

Okay, so I traced the method back to pauldronarmouritem.java and found that 

image.png.a86f739a769b4522252b8ec5cdfdc49f.png

BipedModel extended Living Entity, but when I return it it gives an error

image.png.53a855e8670db8951b9981b4b6561e41.png

Expand  

 

Jesus fucking christ.

image.png.d101b0348b203e7a82d78d60801c82ef.png

  • Like 1
  • Haha 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)

<accidental double post>
 

 

Edited by Draco18s
  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)
return LivingEntity;

1- You don't have to return LivingEntity! You have to return your custom_model class.

2- You have to return an instance of the class. Something like this:

return new custom_model(your constuctor argument);

I'm literally giving you the code, why can't you understand???

Edited by Danebi
  • Like 1
Posted

Please, don't learn java by making minecraft mods, if you don't know what the hell you're doing, then just don't mod minecraft, even if you get spoon-fed by tutorials (Because they want you to get a basic idea of what this does and so, not something to just copy-paste without knowing what it does). Learn java.

Posted

@MostafaSabry55 I'm sorry if my questions seem rhetorical but I have a hard time understanding new concepts, even if you throw an answer at my face. Where is the place where I can learn java the fastest?

 

@ChampionAsh5357 What do you mean by caching the model?, also I put my constructor argument from the registhandler in the custom_model, however does not seem to function correctly.image.thumb.png.db75f3907efc6c4d268e37e065c3d35b.pngimage.png.4ad228cab6dfae1ddd3385a2faad8aa1.png

Posted

Nope, the constructor of your model is this:

 public custom_model(float modelSize)

It requires a float value. Item#Properties is used by items and has nothing to do with the 3d model of your armor. Also what ChampionAsh5357 meant by caching is: right now, you are creating a new instance of your armor model in a function that gets called very often, which is very inefficient. You can just create an instance of your model once and for all in your client class (which is the place that rendering related objects belongs to)..and then returning that instance from getArmorModel. You can think it like that..Its like printing newspapers..normally you have a template newspaper and you can make thousands of prints with only that one template. Instead what you are doing is basically like making a new copy of the newspaper from scratch for every single print you have to do, Sorry if this example was stupid 😄, but i think it can help you understand better what is going on here

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Posted
  On 9/16/2020 at 4:27 PM, iSyriux said:

public custom_model(float modelSize) {

    super(modelSize, 0.0F, 64, 40);

    ModelRenderer bipedBody = new ModelRenderer(this);

    bipedBody.setRotationPoint(0.0F, 0.0F, 0.0F);

    bipedBody.setTextureOffset(0, 32).addBox(-9.0F, 0.0F, -2.0F, 18.0F, 4.0F, 4.0F, 0.25F, false);

}

Expand  

The argument for the custom_model constuctor requires a float. Why are you giving it a Item.Properties?

Posted

Sorry, I didn't realise that I had to use a float.

image.png.6076c7fc325c56c36f052b3cc89081d7.png

I cached the custom model into a variable so I don't need to use new anymore, however, both of the lines give errors

 

Posted (edited)

1) with:

public custom_model(float modelSize)
{
return null;
}

you are not creating a variable, its just the constructor for the custom_model class, which you already have in the model class. Its out of place in your PowerReinforcedArmourItem class, and wrong. Delete it.

 

2)

(float modelSize)

is the parameter requested by the constructor of your custom_model class, so when you are actually creating an object from the class, you need to pass in a value, not a parameter declaration...in this case you need to pass in a float, which is a number...for clarification:

custom_model(float modelSize) // This is a parameter declaration, you are specifying what kind of value your constructor will accept


custom_model(1.0f) // this is how a call to the constructor above will look like when creating a custom_model object, where 1.0f is the float value that will be passed to the contructor parameter "modelSize"

 

Edited by Beethoven92

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Posted

image.png.0917b01a9bc14106dd9d429806ac0c85.png

Okay, thank you for the assistance. I removed the constructor and replaced it with a value, however the custom_model was unknown to the class, so I added a private variable to the class that returned null, but it does not seem to function, even though my code now lacks errors.

image.png.e99afb4b23f6fb1bb0614b1fae61c8a8.pngimage.png.ec5b11d177506684964f8654b24da5af.png

Posted

Again, you did not create an object of your custom_model class, with the last thing you added you now created a function which name is custom_model, which returns null. Then you are returning this function from getArmorModel, so that in the end getArmorModel returns null...this way your armor will never show up, so delete the last line of code you added and listen. To instantiate (create in other terms) a custom_model object you need to use new custom_model(a_float_value) , where a_float_value, as i said above, is a float number. Forget about caching at the moment...

  • Like 1

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Posted

Where do I put new custom_model(a_float_value), I'm sorry if you take this as a bad question, but I scrolled up and I saw that I needed to work on the return, which I had already did

image.png.86113c2bc58c9ba2097869ceedaec81f.png

The error asks me to create a new class, so should I do that? Sorry again, I analysed your answer fully a couple of times and I still can't see where you said to put 

  On 9/16/2020 at 8:54 PM, Beethoven92 said:

new custom_model(a_float_value)

Expand  

 

Posted

The code above is now correct, even if it is terribly inefficient for the reasons i explained above. You already created a class named custom_model...you probably did not import it in the PowerReinforcedArmourItem file. When you hover with the mouse on the line that gives you the error it should also ask you if you want to import the package containing your custom_model class.

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Posted
  On 9/16/2020 at 4:27 PM, iSyriux said:

(here is the full code for reference)

// Made with Blockbench 3.6.3
// Exported for Minecraft version 1.15
// Paste this class into your mod and generate all required imports


public class custom_model extends BipedModel<LivingEntity> {
   private final ModelRenderer bipedHead;
   private final ModelRenderer bipedHeadwear;
   private final ModelRenderer bipedBody;
   private final ModelRenderer bipedRightLeg;
   private final ModelRenderer bipedLeftLeg;
   private final ModelRenderer bipedLeftArm;
   private final ModelRenderer bipedRightArm;

   public custom_model(float modelSize) {
      super(modelSize, 0.0F, 64, 40);

      ModelRenderer bipedBody = new ModelRenderer(this);
      bipedBody.setRotationPoint(0.0F, 0.0F, 0.0F);
      bipedBody.setTextureOffset(0, 32).addBox(-9.0F, 0.0F, -2.0F, 18.0F, 4.0F, 4.0F, 0.25F, false);

   }

   public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
      modelRenderer.rotateAngleX = x;
      modelRenderer.rotateAngleY = y;
      modelRenderer.rotateAngleZ = z;
   }
}
Expand  

This was your original custom_model class, it exists and you do not need to create another one, so delete the last things you added. The custom_model class, from what i can see by your picture is located in com.isyriux.divinerod.armour package, right? Which is the same package as the PowerReenforcedArmourItem class...so in theory you do not even need to import the package.

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Posted

Thank you for your excellent comprehension of my question, so I imported the custom_model class but it appears as red and is not used? Is there any way I can make it be used?

image.thumb.png.ab09d20331936e27de31626c0c2edd75.png

Posted

I didn't..? I put it in PowerReenforcedArmourItem

Also I think you think that I had a custom model class before, but it was just the suggestion the error gave me two posts above. 

Posted (edited)

@iSyriux since you asked, I'd really start by reading java tutorials (not watching, who wants to waste 1 hour watching a video when you can read it in 5 minutes?)

 

There're many sources, I referred to geeks for geeks sometimes, https://www.tutorialspoint.com/java/ is also one that I learned java from and alot more, uncle google has the answers

 

Also btw, using a class name such as custom_model isnt really good, would be better if you call it Custom_Model atleast, if anyone was taking a quick look at your code they might think it's a variable instead of a class.

Edited by MostafaSabry55
Posted
  On 9/17/2020 at 8:49 AM, MostafaSabry55 said:

would be better if you call it Custom_Model atleast

Expand  

Upper camel case is the correct formatting for file names. It should specify what the class is followed by a suffix of the object it's representing. In this case, you are making some power reinforced armor (im american sue me) so it would be PowerReinforcedArmorModel.

 

  On 9/16/2020 at 11:07 PM, iSyriux said:

Also I think you think that I had a custom model class before

Expand  

I don't need to think you think that I think anything. Your pictures show a name with that class. So what you think that I think isn't applicable to the actual scenario.

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Bienvenue dans notre guide complet sur le Code promo Temu 100€ de réduction, une opportunité exceptionnelle pour économiser sur vos achats en ligne. Chez Temu, la qualité rencontre des prix imbattables, et avec ce code promo, vous bénéficiez d’une réduction incroyable. Le code acy240173Code promo Temuest spécialement conçu pour offrir les meilleurs avantages aux utilisateurs francophones. Que vous soyez en France ou dans un autre pays francophone, ce code vous garantit des économies maximales. Que vous soyez un nouveau client ou un utilisateur fidèle, le Code promo Temu2025 for existing customers et le Temu 100€ discount coupon vous permettent de profiter de remises importantes. Nous sommes là pour vous guider afin que vous ne manquiez aucune offre. Qu’est-ce que le Code promo Temu 100€ de réduction ? Le promo Temu 100€ off est un code promo valable aussi bien pour les nouveaux que pour les clients existants. En l’utilisant sur l’application ou le site web Temu, vous pouvez bénéficier d’une réduction immédiate de 100€ sur votre commande. Voici les avantages du code acy240173: acy240173: Réduction fixe de 100€ pour les nouveaux utilisateurs. acy240173: 100€ de réduction également pour les utilisateurs existants. acy240173: Pack de coupons de 100€ utilisables plusieurs fois. acy240173: Remise fixe de 100€ pour les nouveaux clients francophones. acy240173: Code promo supplémentaire de 100€ pour les clients réguliers. Code promo Temu 100€ de réduction Pour Nouveaux Utilisateurs Les nouveaux utilisateurs obtiennent les meilleures offres avec notre code promo sur l’application Temu. Le promo Temu 100€ off et le Code promo Temu40 off for existing users vous ouvrent la porte à des économies exceptionnelles. Voici comment le code acy240173profite aux nouveaux utilisateurs : acy240173: Remise fixe de 100€ sur la première commande. acy240173: Pack de coupons d’une valeur de 100€ pour les nouveaux clients. acy240173: Jusqu’à 100€ de coupons cumulables pour plusieurs achats. acy240173: Livraison gratuite en France pour les nouveaux clients. acy240173: 30% de réduction supplémentaire sur tout achat pour les premiers utilisateurs. Comment utiliser le Temu 100€ Off Coupon Code pour les Nouveaux Clients ? Pour profiter du Temu 100€ off et du Temu 40 off coupon code, suivez ces étapes simples : Téléchargez l’application Temu ou rendez-vous sur le site officiel. Créez un compte ou connectez-vous si vous êtes déjà inscrit. Ajoutez vos articles préférés au panier. À la page de paiement, saisissez le code promo acy240173dans le champ prévu. Cliquez sur « Appliquer » pour voir la réduction de 100€ s’appliquer. Finalisez votre commande et profitez de vos économies. Code promo Temu 100€ de réduction Pour Clients Existants Les clients existants peuvent également bénéficier d’avantages en utilisant notre code promo. Le Temu 40 off coupon code et le Code promo Temufor existing customers sont faits pour vous faire économiser davantage. Les bénéfices du code acy240173pour les clients fidèles : acy240173: Réduction supplémentaire de 100€ pour les utilisateurs existants. acy240173: Pack de coupons de 100€ pour plusieurs achats. acy240173: Cadeau gratuit avec livraison express partout en France. acy240173: 30% de réduction supplémentaire en plus des promotions en cours. acy240173: Livraison gratuite en France pour les clients réguliers. Comment utiliser le Code promo Temu 100€ de réduction pour Clients Existants ? Utiliser le Code promo Temu40 off et le Temu discount code for existing users est simple : Connectez-vous à votre compte Temu. Ajoutez les articles souhaités à votre panier. Entrez le code promo acy240173dans le champ « Code promo » lors du paiement. Appliquez la réduction et vérifiez que 100€ sont déduits. Finalisez votre achat et profitez de votre remise. Comment trouver le Code promo Temu 100€ de réduction ? Pour obtenir le Code promo Temu 100€ de réduction first order et les latest promo Temus 40 off, inscrivez-vous à la newsletter Temu. Vous recevrez ainsi des coupons testés et vérifiés directement dans votre boîte mail. N’hésitez pas à suivre Temu sur ses réseaux sociaux pour découvrir les dernières promotions. Vous pouvez aussi consulter des sites de coupons fiables en français pour trouver les codes les plus récents et fonctionnels. Comment fonctionnent les coupons Temu 100€ Off ? Le Code promo Temu 100€ de réduction first time user et le Code promo Temu40 percent off offrent une réduction immédiate de 100€ lors de votre commande. En entrant le code promo au moment du paiement, le montant total de votre panier est réduit. Ce système est conçu pour être simple et accessible, que vous soyez un nouveau client ou un habitué, et il n’y a pas de minimum d’achat requis. Comment gagner des coupons 100€ Off chez Temu en tant que nouveau client ? En tant que nouveau client, vous pouvez obtenir le Code promo Temu 100€ de réduction et le Temu 40 off coupon code first order en vous inscrivant sur Temu. Vous recevrez des offres exclusives lors de votre première commande, ainsi que des opportunités supplémentaires pour accumuler des réductions grâce à des promotions et des jeux proposés par Temu. Quels sont les avantages d’utiliser les coupons Temu 100€ Off ? Les avantages du Temu 100€ off coupon code legit et du coupon code for Temu 40 off sont nombreux : Réduction de 100€ sur la première commande. Pack de coupons de 100€ pour plusieurs utilisations. Jusqu’à 70% de réduction sur des articles populaires. 30% de réduction supplémentaire pour les clients existants. Jusqu’à 90% de réduction sur certains produits sélectionnés. Cadeau gratuit pour les nouveaux utilisateurs. Livraison gratuite en France. Cadeau gratuit et réduction spéciale pour nouveaux et anciens utilisateurs Temu Avec le Temu 100€ off coupon code et le 100€ off promo Temu code, vous bénéficiez de multiples avantages. Voici ce que le code acy240173vous offre : acy240173: 100€ de réduction sur la première commande. acy240173: 30% de réduction supplémentaire sur tout article. acy240173: Cadeau gratuit pour les nouveaux utilisateurs. acy240173: Jusqu’à 70% de réduction sur tous les articles de l’application Temu. acy240173: Cadeau gratuit avec livraison gratuite en France. Avantages et inconvénients de l’utilisation du Code promo Temu 100€ de réduction Avantages : Réduction immédiate de 100€. Pas de minimum d’achat requis. Valable pour nouveaux et anciens clients. Compatible avec d’autres promotions. Livraison gratuite en France. Inconvénients : Utilisation limitée à un seul compte. Certaines exclusions possibles sur certains produits. Non cumulable avec certaines offres spéciales. Conditions générales du code promo Temu 100€ Off en 2025 Voici les conditions du Code promo Temu 100€ de réduction free shipping et du Code promo Temu 100€ de réduction reddit : Les codes promo n’ont pas de date d’expiration et sont utilisables à tout moment. Valables pour tous les utilisateurs en France, nouveaux et existants. Aucun minimum d’achat requis pour bénéficier de la réduction. Combinaison possible avec d’autres offres. Usage limité à une fois par compte. Conclusion Le Code promo Temu 100€ de réduction est une opportunité à ne pas manquer pour réaliser des économies importantes sur vos achats. Nous vous recommandons vivement d’utiliser ce code pour profiter de réductions exclusives. Avec le Temu 100€ off coupon, vous bénéficiez non seulement d’une remise généreuse mais aussi d’avantages supplémentaires comme la livraison gratuite et des cadeaux. Faites vos achats malin dès aujourd’hui ! FAQ sur le Temu 100€ Off Coupon 1. Le code promo Temu 100€ off est-il valable pour tous les clients ?  Oui, il est valable pour les nouveaux comme pour les clients existants en France. 2. Y a-t-il un minimum d’achat pour utiliser le code ?  Non, il n’y a aucune exigence de montant minimum pour profiter de la réduction. 3. Comment trouver les derniers codes promo Temu ?  Inscrivez-vous à la newsletter Temu et suivez leurs réseaux sociaux pour recevoir les offres les plus récentes. 4. Puis-je utiliser le code plusieurs fois ?  Le code est limité à une utilisation par compte utilisateur. 5. Quels autres avantages offre le code promo Temu 100€ off ?  En plus de la réduction, vous pouvez bénéficier de cadeaux gratuits et de la livraison offerte en France.    
    • After some time minecraft crashes with an error. Here is the log https://drive.google.com/file/d/1o-2R6KZaC8sxjtLaw5qj0A-GkG_SuoB5/view?usp=sharing
    • The specific issue is that items in my inventory wont stack properly. For instance, if I punch a tree down to collect wood, the first block I collected goes to my hand. So when I punch the second block of wood to collect it, it drops, but instead of stacking with the piece of wood already in my hand, it goes to the second slot in my hotbar instead. Another example is that I'll get some dirt, and then when I'm placing it down later I'll accidentally place a block where I don't want it. When I harvest it again, it doesn't go back to the stack that it came from on my hotbar, where it should have gone, but rather into my inventory. That means that if my inventory is full, then the dirt wont be picked up even though there should be space available in the stack I'm holding. The forge version I'm using is 40.3.0, for java 1.18.2. I'll leave the mods I'm using here, and I'd appreciate it if anybody can point me in the right direction in regards to figuring out how to fix this. I forgot to mention that I think it only happens on my server but I&#39;m not entirely sure. PLEASE HELP ME! LIST OF THE MODS. aaa_particles Adorn AdvancementPlaques AI-Improvements AkashicTome alexsdelight alexsmobs AmbientSounds amwplushies Animalistic another_furniture AppleSkin Aquaculture aquamirae architectury artifacts Atlas-Lib AutoLeveling AutoRegLib auudio balm betterfpsdist biggerstacks biomancy BiomesOPlenty blockui blueprint Bookshelf born_in_chaos Botania braincell BrassAmberBattleTowers brutalbosses camera CasinoCraft cfm (MrCrayfish’s Furniture Mod) chat_heads citadel cloth-config Clumps CMDCam CNB cobweb collective comforts convenientcurioscontainer cookingforblockheads coroutil CosmeticArmorReworked CozyHome CrabbersDelight crashexploitfixer crashutilities Create CreativeCore creeperoverhaul cristellib crittersandcompanions Croptopia CroptopiaAdditions CullLessLeaves curios curiouslanterns curiouslights Curses' Naturals CustomNPCs CyclopsCore dannys_expansion decocraft Decoration Mod DecorationDelightRefurbished Decorative Blocks Disenchanting DistantHorizons doubledoors DramaticDoors drippyloadingscreen durabilitytooltip dynamic-fps dynamiclights DynamicTrees DynamicTreesBOP DynamicTreesPlus Easy Dungeons EasyAnvils EasyMagic easy_npc eatinganimation ecologics effective_fg elevatorid embeddium emotecraft enchantlimiter EnchantmentDescriptions EnderMail engineersdecor entityculling entity_model_features entity_texture_features epicfight EvilCraft exlinefurniture expandability explosiveenhancement factory-blocks fairylights fancymenu FancyVideo FarmersDelight fast-ip-ping FastSuite ferritecore finsandtails FixMySpawnR Forge Middle Ages fossil FpsReducer2 furnish GamingDeco geckolib goblintraders goldenfood goodall H.e.b habitat harvest-with-ease hexerei hole_filler huge-structure-blocks HunterIllager iammusicplayer Iceberg illuminations immersive_paintings incubation infinitybuttons inventoryhud InventoryProfilesNext invocore ItemBorders itemzoom Jade jei (Just Enough Items) JetAndEliasArmors journeymap JRFTL justzoom kiwiboi Kobolds konkrete kotlinforforge lazydfu LegendaryTooltips libIPN lightspeed lmft lodestone LongNbtKiller LuckPerms Lucky77 MagmaMonsters malum ManyIdeasCore ManyIdeasDoors marbledsarsenal marg mcw-furniture mcw-lights mcw-paths mcw-stairs mcw-trapdoors mcw-windows meetyourfight melody memoryleakfix Mimic minecraft-comes-alive MineTraps minibosses MmmMmmMmmMmm MOAdecor (ART, BATH, COOKERY, GARDEN, HOLIDAYS, LIGHTS, SCIENCE) MobCatcher modonomicon mods_optimizer morehitboxes mowziesmobs MutantMonsters mysticalworld naturalist NaturesAura neapolitan NekosEnchantedBooks neoncraft2 nerb nifty NightConfigFixes nightlights nocube's_villagers_sell_animals NoSeeNoTick notenoughanimations obscure_api oculus oresabovediamonds otyacraftengine Paraglider Patchouli physics-mod Pillagers Gun PizzaCraft placeableitems Placebo player-animation-lib pneumaticcraft-repressurized polymorph PrettyPipes Prism projectbrazier Psychadelic-Chemistry PuzzlesLib realmrpg_imps_and_demons RecipesLibrary reeves-furniture RegionsUnexplored restrictedportals revive-me Scary_Mobs_And_Bosses selene shetiphiancore ShoulderSurfing smoothboot
    • Hi everyone, I'm currently developing a Forge 1.21 mod for Minecraft and I want to display a custom HUD overlay for a minigame. My goal: When the game starts, all players should see an item/block icon (from the base game, not a custom texture) plus its name/text in the HUD – similar to how the bossbar overlay works. The HUD should appear centered above the hotbar (or at a similar prominent spot), and update dynamically (icon and name change as the target item changes). What I've tried: I looked at many online tutorials and several GitHub repos (e.g. SeasonHUD, MiniHUD), but most of them use NeoForge or Forge versions <1.20 that provide the IGuiOverlay API (e.g. implements IGuiOverlay, RegisterGuiOverlaysEvent). In Forge 1.21, it seems that neither IGuiOverlay nor RegisterGuiOverlaysEvent exist anymore – at least, I can't import them and they are missing from the docs and code completion. I tried using RenderLevelStageEvent as a workaround but it is probably not intended for custom HUDs. I am not using NeoForge, and switching the project to NeoForge is currently not an option for me. I tried to look at the original minecraft source code to see how elements like hearts, hotbar etc are drawn on the screen but I am too new to Minecraft modding to understand. What I'm looking for: What is the correct way to add a custom HUD element (icon + text) in Forge 1.21, given that the previous overlay API is missing? Is there a new recommended event, callback, or method in Forge 1.21 for custom HUD overlays, or is everyone just using a workaround? Is there a minimal open-source example repo for Forge 1.21 that demonstrates a working HUD overlay without relying on NeoForge or deprecated Forge APIs? My ideal solution: Centered HUD element with an in-game item/block icon (from the base game's assets, e.g. a diamond or any ItemStack / Item) and its name as text, with a transparent background rectangle. It should be visible to the players when the mini game is running. Easy to update the item (e.g. static variable or other method), so it can change dynamically during the game. Any help, code snippets, or up-to-date references would be really appreciated! If this is simply not possible right now in Forge 1.21, it would also help to know that for sure. Thank you very much in advance!
  • Topics

×
×
  • Create New...

Important Information

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