Jump to content

braian hernandez

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by braian hernandez

  1. Hello, im trying to add a new mob into my mod using GeckoLib as dependency, but when i see in-game, it dont have animations, but texture and model works fine. Animation part in my entity: // GeckoLib Animation private <E extends IAnimatable> PlayState predicate(AnimationEvent<E> event) { if (event.isMoving()) { event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.mutant_golem.walk", true)); return PlayState.CONTINUE; } if(this.isDeadOrDying()){ event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.mutant_golem.death", false)); return PlayState.CONTINUE; } event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.mutant_golem.idle", true)); return PlayState.CONTINUE; } @Override public void registerControllers(AnimationData data) { data.addAnimationController(new AnimationController(this,"controller", 0,this::predicate)); } @Override public AnimationFactory getFactory() { return factory; } Im already check that event.isMoving() return true, but my mob dont do animations.
  2. Well, like Capricocious say, its impossible to edit vanilla content directly, but, you can edit them in events, and add to them the property to be unbreakable. You just need to ensure what event you want to edit, also, other option is to create your own netherite items extending current vanilla, and when player gets a vanilla netherite item you override it, like in crafting recipes.
  3. Hm... i do something similar in my mod in version 1.19.2, you need to edit model, im use the json file, so when it is in hand it have other dimensions, but if you want that the model in hand be tottaly diferent, you need to create an model, and then, you need to add renderer, so when you equip that, you render the model, like 3d model, or whatever you like.
  4. Could you give some code to see what you have done? To do that, first you need to find where the item receive enchantments. Then in that instance you add a if statment to do that. Other way is to copy enchants that the item will receive, and, then check if that some enchant have certain enchant, and remove it from the item, and re enchant to add in the level you want.
  5. I use event,setCanceled(true) in various events, because i need to know if vanilla change something, actually i cancel: Regeneration Event Damage event Hurt event Attack event Some of the Gui event I dont know it that affect somehow, other events, i fix when i found error. I have some packets, to sync all player capability and try to do same for all living entity, but it is hard, for that way i have another problem, when player leave and join again, something go wrong and max life dont render correctly, now i will work to fix that, and i dont know how to do for living entity dont leave and join again with the level, so they dont get all capability again, that change their rank capability, life, level and armor. Sorry, first time that i request help, so i dont know that, sure, i have always upload github project. Code start in line 837 https://github.com/JuanHernandezMorani/Perfect-Minecraft-rpg-1.19.2/blob/main/src/main/java/net/cheto97/rpgcraftmod/event/ModEvents.java
  6. Hi to everyone, i need help to render custom name on Crafted Items, for my mod in minecraft 1.19.2 forge, i try many forms, but cant add name and edit values like attack damage, durability, attack speed, attack reach, armor, armor thoughness. I have this: @SubscribeEvent public static void onCraftedItem(PlayerEvent.ItemCraftedEvent event) { Player entity = event.getEntity(); int level = entity.getCapability(CustomLevelProvider.ENTITY_CUSTOMLEVEL).map(Customlevel::get).orElse(1); double luck = entity.getCapability(LuckProvider.ENTITY_LUCK).map(Luck::get).orElse(1.0); temStack output = event.getCrafting(); if(luck > 10000){ luck = 10000; } int opt = selectTier(luck-1); if(!event.getEntity().getLevel().isClientSide()){ String name = output.getDisplayName().getString(); switch (opt) { case 1 -> { Component iQualityComponent = Component.literal("[Crafted - Common] - {"+level+"} "+name).withStyle(ChatFormatting.GRAY); output.setHoverName(iQualityComponent); extra = 0.1*(double)((level/10000)+1); } *others cases* } Item item = output.getItem(); double lvlExtra = (level*0.00025)+1; if (item instanceof BowItem) { entity.getCapability(DexterityProvider.ENTITY_DEXTERITY).ifPresent(extraDamage -> { var customDamage = lvlExtra*(1 + (2+(extraDamage.get()*0.0015))*(4.15*0.35)*1.1)+(1.1*extra); output.setDamageValue((int)customDamage); event.setCanceled(true); event.getInventory().setItem(1,output); }); } else if(item instanceof CrossbowItem){ entity.getCapability(DexterityProvider.ENTITY_DEXTERITY).ifPresent(extraDamage -> { var customDamage = lvlExtra*(1 + (2+(extraDamage.get()*0.0015))*(4.15*0.35)*1.1)+(1.1*extra); output.setDamageValue((int)customDamage); event.setCanceled(true); event.getInventory().setItem(1,output); }); } else if(item instanceof TridentItem){ entity.getCapability(DexterityProvider.ENTITY_DEXTERITY).ifPresent(extraDamage -> { var customDamage = lvlExtra*((1+(extraDamage.get()*0.0025))*(2.15*0.25)*1.9)+(1.9*extra); output.setDamageValue((int)customDamage); event.setCanceled(true); event.getInventory().setItem(1,output); }); } else if(item instanceof PickaxeItem){ entity.getCapability(IntelligenceProvider.ENTITY_INTELLIGENCE).ifPresent(stat ->{ var customDamage = lvlExtra*((1+(stat.get()*0.0025))*(2.15*0.25)*1.9)+(1.9*extra); output.setDamageValue((int)customDamage); event.setCanceled(true); event.getInventory().setItem(1,output); }); } else if(item instanceof AxeItem){ entity.getCapability(StrengthProvider.ENTITY_STRENGTH).ifPresent(stat ->{ var customDamage = lvlExtra*((1+(stat.get()*0.0025))*(2.15*0.25)*1.9)+(1.9*extra); output.setDamageValue((int)customDamage); event.setCanceled(true); event.getInventory().setItem(1,output); }); } else if(item instanceof SwordItem){ entity.getCapability(StrengthProvider.ENTITY_STRENGTH).ifPresent(stat ->{ var customDamage = lvlExtra*((1+(stat.get()*0.0025))*(2.15*0.25)*1.9)+(1.9*extra); output.setDamageValue((int)customDamage); event.setCanceled(true); event.getInventory().setItem(1,output); }); } else if(item instanceof HoeItem){ entity.getCapability(AgilityProvider.ENTITY_AGILITY).ifPresent(stat ->{ var customDamage = lvlExtra*((1+(stat.get()*0.0025))*(2.15*0.25)*1.9)+(1.9*extra); output.setDamageValue((int)customDamage); event.setCanceled(true); event.getInventory().setItem(1,output); }); } } } I want to know how i can do to receive the item i do. When i use println, i can see that the hoverName is correctly apply, and if i try with a tag, it is added too, but not displayed.
×
×
  • Create New...

Important Information

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