• Problème au lancement de minecraft

    Déplacé topic_solved 1.12.2
    3
    1
    0 Votes
    3 Messages
    322 Vues
    L
    Bon je crois que j’ai compris le probléme. en faite c’est eclipse qui ne peut pas lançer de projet car aucun projet n’est séléctionné. Pour le résoudre: Ouvrir un fichier ou cliquer sur un fichier qui est déjà ouvert et réessayez de lancer le projet
  • Formulation mathématique pour retrouver un level à partir d'xp donné !

    Déplacé topic_solved 1.12.2
    5
    0 Votes
    5 Messages
    408 Vues
    KporalK
    @SubscribeEvent public void entitySpawn( LivingSpawnEvent event ) { if( event.getEntity() instanceof EntityMob && Configs.allowMobLevel ) { /* ( 10 * rand( 5 )) + ( 10 * rand( 5 ) * rand( 5 )) * 0 + 0 * 0 = 0 * 10 + 10 * 1 = 20 * 20 + 20 * 2 = 60 * 30 + 30 * 3 = 120 * 40 + 40 * 4 = 200 * 50 + 50 * 5 = 300 */ int xp = new Random().nextInt( 300 ); int level = ( int ) (( Math.sqrt( 20 * ( 2 * xp + 5 )) + 10 ) / 20); int invert = 5 - level; EntityMob mob = ( EntityMob ) event.getEntity(); if( invert == 5 ) mob.setCustomNameTag( TextFormatting.OBFUSCATED + mob.getCustomNameTag() ); IAttributeInstance mobMaxHealth = mob.getEntityAttribute( SharedMonsterAttributes.MAX_HEALTH ); double maxHealth = mobMaxHealth.getBaseValue() + ( mobMaxHealth.getBaseValue() / 5 * invert); mobMaxHealth.setBaseValue( maxHealth ); mob.setHealth(( float ) mobMaxHealth.getBaseValue() ); IAttributeInstance mobAttack = mob.getEntityAttribute( SharedMonsterAttributes.ATTACK_DAMAGE ); double attack = mobAttack.getBaseValue() + ( mobAttack.getBaseValue() / 5 * invert); mobAttack.setBaseValue( attack ); } } Sujet résolu
  • Comment changer le drop d'un block ?

    Déplacé topic_solved 1.12.2
    3
    0 Votes
    3 Messages
    220 Vues
    K
    Merci ça marche
  • Préciser le type d'enchantement d'un objet

    Déplacé topic_solved 1.12.2
    5
    0 Votes
    5 Messages
    351 Vues
    KporalK
    Bon bah merci quand même pour l’aide je vais faire autrement
  • Problème avec le GameRegistery

    Déplacé topic_solved 1.12.2
    6
    0 Votes
    6 Messages
    663 Vues
    L
    @robin4002 Encore une question est-ce que c’est simple de portabiliser son code de la 1.7.10 -> à la 1.12.2?
  • Ingame overlay

    Déplacé topic_solved 1.12.2
    2
    0 Votes
    2 Messages
    346 Vues
    KporalK
    Encore une fois je m’y prend mal, problème résolu : @SideOnly( Side.CLIENT ) @SubscribeEvent public void onRender( RenderGameOverlayEvent.Post event ) { Minecraft minecraft = Minecraft.getMinecraft(); RenderItem render = minecraft.getRenderItem(); EntityPlayer player = minecraft.player; if( event.getType() != ElementType.EXPERIENCE || !Configs.armorOverlay || player.isSpectator() ) return; ItemStack helmet = player.inventory.armorItemInSlot( 3 ); ItemStack chest = player.inventory.armorItemInSlot( 2 ); ItemStack leggings = player.inventory.armorItemInSlot( 1 ); ItemStack boots = player.inventory.armorItemInSlot( 0 ); int positionX = Configs.armorOverlayX; int positionY = Configs.armorOverlayY; if( !helmet.isEmpty() ) { drawItemDurability( helmet, minecraft, positionX, positionY ); positionY += 16; } if( !chest.isEmpty() ) { drawItemDurability( chest, minecraft, positionX, positionY ); positionY += 16; } if( !leggings.isEmpty() ) { drawItemDurability( leggings, minecraft, positionX, positionY ); positionY += 16; } if( !boots.isEmpty() ) { drawItemDurability( boots, minecraft, positionX, positionY ); } } private void drawItemDurability( ItemStack stack, Minecraft minecraft, int posX, int posY ) { minecraft.getRenderItem().renderItemAndEffectIntoGUI( stack, posX, posY ); int damage = stack.getMaxDamage() - stack.getItemDamage(); int size = Math.round( damage * 12 / stack.getMaxDamage() ); int color = size <= 2 ? Color.RED.getRGB() : size <= 6 ? Color.ORANGE.getRGB() : Color.GREEN.getRGB(); minecraft.ingameGUI.drawRect( posX + 2, posY + 15, posX + 14, posY + 16, Color.BLACK.getRGB() ); minecraft.ingameGUI.drawRect( posX + 2, posY + 15, posX + 2 + size, posY + 16, color ); }
  • Comment enregistrer mon entité et son rendu ?

    Déplacé topic_solved 1.12.2
    3
    0 Votes
    3 Messages
    293 Vues
    KporalK
    Merci ! EntityRegistry.registerModEntity( new ResourceLocation( MODID + ":nightmare" ), EntityNightmare.class, "nightmare", 0, Main.instance, 64, 20, true ); C’est tout bon
  • [1.12.2] 3d OBJ animation custom

    Déplacé topic_solved 1.12.2
    5
    0 Votes
    5 Messages
    515 Vues
    P
    je trouvait pas du coup j’ai coder une petite classe qui me permet de faire ce que j’ai besoin merci quand même du coup de main
  • Tag remove sur une entité

    Déplacé topic_solved 1.12.2
    4
    0 Votes
    4 Messages
    283 Vues
    KporalK
    Pffff je suis naze … private void itemSoulKeeperRelease( EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand ) { if( !worldIn.isRemote ) { if( player.getHeldItemMainhand().getTagCompound().hasKey( "entity" ) ) { NBTBase nbt = player.getHeldItemMainhand().getTagCompound().getTag( "entity" ); NBTTagCompound nbtc = (NBTTagCompound) nbt; Entity entity = AnvilChunkLoader.readWorldEntityPos( nbtc, worldIn, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), true); player.getHeldItemMainhand().getTagCompound().removeTag( "entity" ); } } } Problème résolu ( tester avec cheval, selle et armure, mais aussi avec mule selle et coffre tout est bien recréer )
  • [1.12.2] savoir quel entité le joueur regarde

    Déplacé topic_solved 1.12.2
    6
    0 Votes
    6 Messages
    375 Vues
    I
    C’est bon j’ai réussi mais en utilisant ce morceau de code: final Minecraft mc = Minecraft.getMinecraft(); final RayTraceResult ray = mc.objectMouseOver; Puis pour l’entité est donné par: ray.entityHit
  • Inventaire multi fonction ( IItemHandler vs IInventory )

    Déplacé topic_solved 1.12.2
    22
    0 Votes
    22 Messages
    1k Vues
    KporalK
    Fin du code : ( pour rendre le contenu permanent ) @SubscribeEvent public void cloneEvent( PlayerEvent.Clone e ) { if( e.isWasDeath() ) { KitbagHandler o = e.getOriginal().getCapability( KitbagCapability.VOIDSTORAGE_CAPABILITY, null ); KitbagHandler i = e.getEntityPlayer().getCapability( KitbagCapability.VOIDSTORAGE_CAPABILITY, null ); for( int k = 0; k < o.getSlots(); k++ ) { i.insertItem( k, o.getStackInSlot( k ), false ); } } } @SubscribeEvent public void addCapability( AttachCapabilitiesEvent<Entity> event ) { if( event.getObject() instanceof EntityPlayer ) { event.addCapability( new ResourceLocation( Main.MODID, "voidStorage" ), new KitbagProvider() ); } }
  • [1.12.2]La Texture de Mon armure ne veux pas s'afficher

    Déplacé topic_solved 1.12.2
    5
    0 Votes
    5 Messages
    424 Vues
    HeavenH
    je pense que c était liée à la majuscule :beaming_face_with_smiling_eyes: Edit je test sans les majs c était bien les majuscules qui bloquais tout je suis vraiment un boulet
  • addPotionEffect > Failed to handle packet

    Déplacé topic_solved 1.12.2
    3
    0 Votes
    3 Messages
    249 Vues
    KporalK
    Problème résolu, grossière erreur de ma pars d’autant plus que … hum je cherche à récupérer inutilement un slot précis alors que la fonction donne par défaut … et oui l’item en question ( le recule est censé être bien mais parfois on se sent juste con ) package com.kporal.mcplus.items; import com.kporal.mcplus.Main; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.MobEffects; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class DragoonArmor extends ItemArmor { public DragoonArmor( ArmorMaterial material, EntityEquipmentSlot slot, String name ) { super( material, 0, slot ); this.setRegistryName( name ); this.setTranslationKey( name ); this.setCreativeTab( Main.mcptab ); } @Override public void onArmorTick( World w, EntityPlayer p, ItemStack i ) { if( i.getItem() == Main.cursedBoots ) { potionEffect( p, MobEffects.FIRE_RESISTANCE, 5, 1, false, false ); } if( i.getItem() == Main.cursedLegs ) { potionEffect( p, MobEffects.SPEED, 5, 0, false, false ); } if( i.getItem() == Main.cursedChest ) { potionEffect( p, MobEffects.REGENERATION, 5, 0, false, false ); } if( i.getItem() == Main.cursedHelmet ) { potionEffect( p, MobEffects.NIGHT_VISION, 5, 2, false, false ); } } private int secondToTicks( int s ) { return s * 20; } private void potionEffect( EntityPlayer player, Potion e, int t, int p, boolean ambiant, boolean particle ) { if( player.getActivePotionEffect( e ) == null ) { player.addPotionEffect( new PotionEffect( e, secondToTicks( t ), p, ambiant, particle )); } } } Problème résolu et sa fonctionne. Merci de ton aide !
  • Bloc (type machine) ne fonctionne pas

    Déplacé topic_solved 1.12.2
    17
    0 Votes
    17 Messages
    1k Vues
    Gollum1erG
    Oww !!! SUPER MERCI !! + 1 de réputation !
  • Problème de persistance avec une capability

    Déplacé topic_solved 1.12.2
    3
    0 Votes
    3 Messages
    317 Vues
    L
    Ah ! Très bien, au moins c’était rapide :beaming_face_with_smiling_eyes:. Merci beaucoup, cela fonctionne aussi bien sur le client que sur le serveur !
  • Cacher les identifiants SQL au client ?

    Déplacé topic_solved 1.12.2
    23
    0 Votes
    23 Messages
    2k Vues
    C
    Tout fonctionne, merci.
  • Dessiner une entitée dans un GUI

    Déplacé topic_solved 1.12.2
    5
    0 Votes
    5 Messages
    521 Vues
    CiolgamingC
    GuiInventory.drawEntityOnScreen(mc.displayWidth/8, mc.displayHeight/6, 30, (mc.displayWidth/8) - mouseX, (mc.displayHeight/12) - mouseY, new EntityPig(Minecraft.getMinecraft().world)); T’as simplement à get le monde de la class Minecraft
  • Problème lors de la compilation du mod

    Déplacé topic_solved 1.12.2
    6
    0 Votes
    6 Messages
    425 Vues
    D
    Merci
  • Problème de Code avec Register et getRegistery

    Déplacé topic_solved 1.12.2
    6
    0 Votes
    6 Messages
    522 Vues
    robin4002R
    @Flow-Arg a dit dans Problème de Code avec Register et getRegistery : Salut, c’est RegistryEvent.Register<Item> et pas RegisteringEvent qui peut tout a fait etre le nom de ta classe si tu veux @Dodo_Report Effectivement j’avais mal vu x)
  • Les Events ne se lancent pas

    Déplacé topic_solved 1.12.2
    3
    0 Votes
    3 Messages
    280 Vues
    uiyttU
    Je me déteste, je suis un imbécile xD, j’ai pas verifié l’event, cet évent s’active quand un joueur meurt et non quand il drop un item… Désolé du dérangement