• Problème avec les "Capabilities"

    Déplacé Résolu 1.12.2
    12
    2
    0 Votes
    12 Messages
    602 Vues
    Vort3x_V
    Bon j’ai finalement réglé le problème de “capabilities”, je passe donc ce poste en résolu. Encore merci pour vos réponses.
  • Autoriser un enchantement spécifique pour un item spécifique

    Déplacé Résolu 1.12.2
    2
    0 Votes
    2 Messages
    159 Vues
    L
    Bonjour, Après avoir fouiller d’avantage dans les enchantements, je me suis rendu compte que pour vérifier si l’enchantement “unbreaking” peut s’appliquer à un item ou non, forge vérifi si l’item a une durabilité ou non. Et dans mon cas, mon item n’en avait pas x) Il suffit d’ajouter la ligne suivante dans le constructeur pour ajouter une durabilité à l’item: this.setMaxDamage(250); Et c’est bon
  • Creation d'un fog sous l'eau mais le fog ne change pas

    Déplacé Résolu 1.12.2
    11
    0 Votes
    11 Messages
    698 Vues
    L
    Bonjour, Je viens de trouver un nouveau problème liée à ce code La densité ne change pas. Pour que la densité change, il faudrait changer le code de la fonction de fog: @SubscribeEvent @SideOnly(Side.CLIENT) public void onFogDensity(EntityViewRenderEvent.FogDensity event) { if(this.isUnderWater(event.getEntity(), (float)event.getRenderPartialTicks())) { event.setDensity(density); GlStateManager.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); event.setCanceled(true); changed = true; } else if (changed) { changed = false; event.setDensity(0.0f); event.setCanceled(true); } } Avec des event.setCanceled(true) pour que la densite du fog de base de minecraft ne remplace pas mon fog. J’ai rajouter une variable “changed” pour que lorsqu’il sort de l’eau le fog se remette a la normal. Sa permet d’éviter de call le “reset” à chaque fois, je ne sais pas si c’est une solution qui est la meilleur mais cette magouille fonctionne asser bien ^^
  • Fonction de Packet Server non Appelée

    Déplacé Résolu 1.12.2
    2
    0 Votes
    2 Messages
    178 Vues
    FeedBackF
    @feedback bon, ce problème n’est pas réglable donc j’ai fait un systeme uniquement client side basé sur un fichier sur internet (oui c’est trash). Le problème venait que le server n’a pas l’air de pouvoir récupérer le joueur à ce moment là car il n’est pas encore connecté (enfin je crois) ce qui rend impossible l’envoi de packet
  • Commande Homes

    Déplacé Résolu 1.12.2
    4
    0 Votes
    4 Messages
    277 Vues
    FeedBackF
    @pazzazzo ma commande marche bien en solo mais vu que j’ai un hébergeur nitrado, le fichier des homes est deleted x)
  • Initialise GuiTextField

    Déplacé Résolu 1.12.2
    9
    0 Votes
    9 Messages
    383 Vues
    H
    Je reviens ici après avoir fini mon nouveau GuiChat. Le plus simple est de @Override la fonction keyTyped de Minecraft se trouvant dans GuiChat pour la modifier à notre guise. Vous pouvez assez facilement le faire en Java brut. Le plus compliqué va être TOUT se qu’il a autour (l’auto tabulation, l’open command, la détéction de Shift Droit / Gauche, CTRL etc …). Je ne mettrai pas mon code ici car je vous laisse faire vos propres recherches.
  • Modifier le GUI de l'inventaire

    Déplacé Résolu 1.12.2
    10
    0 Votes
    10 Messages
    1k Vues
    U
    @frealac Il y à des tutos sur l’ajout / modification de GUI. Un pack texture inventaire est juste une texture GUI, une réelle modification du GUI il y à des tutos dessus.
  • Ajout de plusieurs Fluids

    Déplacé Résolu 1.12.2
    37
    0 Votes
    37 Messages
    2k Vues
    Z
    @ck_luky avec un event, le FillBucketEvent : @SubscribeEvent public static void onBucketUsed(FillBucketEvent event) { if(event.getEmptyBucket().getItem() == ItemsMod.BUCKET_VIDE) {// créé un seau moddé vide ou utilise Items.BUCKET de minecraft World eventWorld = event.getWorld(); if(event.getTarget() == null) { return; } BlockPos hitPos = Objects.requireNonNull(event.getTarget()).getBlockPos(); if(event.getTarget().hitVec != null && eventWorld.getBlockState(hitPos) == BlocksMods.FLUID_BLOCK.getDefaultState()) { event.setFilledBucket(new ItemStack(ExaItemsMods.FLUID_BUCKET, 1)); eventWorld.setBlockToAir(hitPos); event.setResult(Event.Result.ALLOW); } } } Comme je l’ai dit en commentaire, il te faut un seau de vide de base qui une fois rempli donne ton fluid bucket(ou tu utilise le bucket de minecraft).
  • Envoi de packets en 1.12.2

    Déplacé Résolu 1.12.2
    7
    0 Votes
    7 Messages
    1k Vues
    Z
    Merci beaucoup ^^ le problème est résolu !
  • Timer Sur Block

    Déplacé Résolu 1.12.2
    3
    0 Votes
    3 Messages
    292 Vues
    FeedBackF
    @lebossmax2 bon bah j’ai rien fait et ca marche xD
  • Faire regarder une entité à un endroit

    Déplacé Résolu 1.12.2
    8
    0 Votes
    8 Messages
    380 Vues
    FeedBackF
    @robin4002 voila mon entité ! public class EntityProjectileBase extends EntityThrowable { public boolean homing = true; private int ticksAlive = 0; protected EntityLivingBase target; protected EntityBabyDragonBase shootingEntity; protected Entity predefTarget; public boolean shouldUpdateTarget = true; private static EnumDragonType dragonType; public EntityProjectileBase(World par1World) { super(par1World); } public EntityProjectileBase(World par1World, Entity par2Entity) { super(par1World); } public EntityProjectileBase(World par1World, EntityBabyDragonBase par3EntityPlayer) { super(par1World, par3EntityPlayer); this.shootingEntity = par3EntityPlayer; } public EntityProjectileBase(World par1World, EntityBabyDragonBase par3EntityPlayer, Entity target) { super(par1World, par3EntityPlayer); this.posY = par3EntityPlayer.posY + 1; this.shootingEntity = par3EntityPlayer; this.predefTarget = target; this.shouldUpdateTarget = false; } public EnumDragonType getDragonType() { return EnumDragonType.NONE; } protected void entityInit() {} protected float getGravityVelocity() { return 0.0F; } protected float func_70182_d() { return 1.2F; } protected float func_70183_g() { return -0.0F; } public void onUpdate() { super.onUpdate(); this.ticksAlive += 1; if(this.ticksAlive >= 300) { setDead(); this.ticksAlive = 0; } if(predefTarget != null) { this.target = (EntityLivingBase)predefTarget; } // TODO - Fix the spawn particle // this.world.spawnParticle("smoke", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); // this.worldObj.spawnParticle("flame", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); if(this.ticksAlive >= 5) { if((this.target == null) || (this.target.velocityChanged) || (!this.target.canEntityBeSeen(this)) || this.target.isDead || this.target.getEntityData().getInteger("missilesTargeting") != this.hashCode()) { if(shouldUpdateTarget) this.target = this.getNearestEntity(); } } if(this.target != null) { double d = this.target.getEntityBoundingBox().minX + (this.target.getEntityBoundingBox().maxX - this.target.getEntityBoundingBox().minX) / 2.0D - this.posX; double d1 = this.target.getEntityBoundingBox().minY + (this.target.getEntityBoundingBox().maxY - this.target.getEntityBoundingBox().minY) / 2.0D - this.posY; double d2 = this.target.getEntityBoundingBox().minZ + (this.target.getEntityBoundingBox().maxZ - this.target.getEntityBoundingBox().minZ) / 2.0D - this.posZ; this.shoot(d, d1, d2, 1.9F, 0.0F); this.posY += (0.5 * Math.sin(this.ticksAlive)); this.posX += (0.5 * Math.cos(this.ticksAlive)); if(this.getDragonType() == EnumDragonType.FIRE) { this.world.spawnParticle(EnumParticleTypes.FLAME, this.posX, this.posY, this.posZ, 0, 0, 0, 0); } else if(this.getDragonType() == EnumDragonType.ICE) { this.world.spawnParticle(EnumParticleTypes.SNOWBALL, this.posX, this.posY, this.posZ, 0, 0, 0, 0); } else if(this.getDragonType() == EnumDragonType.EARTH) { this.world.spawnParticle(EnumParticleTypes.SLIME, this.posX, this.posY, this.posZ, 0, 0, 0, 0); } } float f4 = 0.99F; float f6 = 0.05F; if(!this.homing) { this.motionX *= f4; this.motionY *= f4; this.motionZ *= f4; this.motionY -= f6; } } private EntityLiving getTarget(double d, double d1, double d2, double d3) { double d4 = -1.0D; EntityLiving entityliving = null; List list = this.world.getEntitiesWithinAABBExcludingEntity(getThrower(), this.getEntityBoundingBox().expand(16.0D, 16.0D, 16.0D)); for(int i = 0; i < list.size(); i++) { EntityLiving entityliving1 = (EntityLiving)list.get(i); if(entityliving1 != getThrower()) { double d5 = entityliving1.getDistance(d, d1, d2); if(((d3 < 0.0D) || (d5 < d3 * d3)) && ((d4 == -1.0D) || (d5 < d4)) && (entityliving1.canEntityBeSeen(this))) { d4 = d5; entityliving = entityliving1; } } } return entityliving; } public boolean validTarget(EntityLiving entityliving) { if(entityliving.equals(getThrower())) { return false; } return true; } protected void onImpact(RayTraceResult movingobjectposition) { if(movingobjectposition.entityHit != null) { if(movingobjectposition.entityHit != this.getThrower()) { movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeMobDamage(this.shootingEntity), ((EntityBabyDragonBase)this.getThrower()).getDragonDamage()); if(this.getDragonType() == EnumDragonType.FIRE && !this.world.isRemote) { movingobjectposition.entityHit.setFire(4); } else if(this.getDragonType() == EnumDragonType.ICE && !this.world.isRemote) { ((EntityLivingBase)movingobjectposition.entityHit).addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 20 * 4, 1)); ((EntityLivingBase)movingobjectposition.entityHit).addPotionEffect(new PotionEffect(MobEffects.MINING_FATIGUE, 20 * 4, 0)); } else if(this.getDragonType() == EnumDragonType.EARTH && !this.world.isRemote) { ((EntityLivingBase)movingobjectposition.entityHit).addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 20 * 4, 0)); ((EntityLivingBase)movingobjectposition.entityHit).addPotionEffect(new PotionEffect(MobEffects.HUNGER, 20 * 4, 0)); ((EntityLivingBase)movingobjectposition.entityHit).addPotionEffect(new PotionEffect(MobEffects.POISON, 20 * 4, 0)); } if(!this.world.isRemote) { this.setDead(); } } if(movingobjectposition.entityHit.getEntityData().getInteger("missilesTargeting") != 0) { movingobjectposition.entityHit.getEntityData().setInteger("missilesTargeting", 0); } } else if(!this.world.isRemote) { this.setDead(); } } private EntityLiving getNearestEntity() { EntityLiving target = null; float explosionSize = 10.0F; explosionSize *= 2.0F; int i = MathHelper.floor(this.posX - explosionSize - 1.0D); int j = MathHelper.floor(this.posX + explosionSize + 1.0D); int k = MathHelper.floor(this.posY - explosionSize - 1.0D); int l1 = MathHelper.floor(this.posY + explosionSize + 1.0D); int i2 = MathHelper.floor(this.posZ - explosionSize - 1.0D); int j2 = MathHelper.floor(this.posZ + explosionSize + 1.0D); if(!this.world.isRemote) { List list = this.world.getEntitiesWithinAABBExcludingEntity(getThrower(), new AxisAlignedBB(i, k, i2, j, l1, j2)); for(int k2 = 0; k2 < list.size(); k2++) { Entity entity = (Entity)list.get(k2); if(((entity instanceof EntityLiving)) && (((EntityLiving)entity).canEntityBeSeen(this))) { target = (EntityLiving)entity; if(target.getEntityData().getInteger("missilesTargeting") == 0) { target.getEntityData().setInteger("missilesTargeting", this.hashCode()); return target; } } } } return target; } }
  • Utiliser 2 blockstates

    Déplacé Résolu 1.12.2
    2
    0 Votes
    2 Messages
    166 Vues
    FeedBackF
    Je suis juste un peu bête et j’avais mal formé le json Désolé du dérangement
  • Problème run IntelliJ forge 1.12.2

    Déplacé Résolu 1.12.2
    3
    0 Votes
    3 Messages
    369 Vues
    Helios_38H
    Ouais, finalement j’ai renouvelé mes variables d’environnement et mes JDK et j’ai aussi clean mes caches gradle et réinstaller tous se bordel et sa marche enfin j’ai plus cette erreur. Merci beaucoup;
  • Uncmlaim finder en 1.12.2

    Déplacé Résolu 1.12.2
    40
    0 Votes
    40 Messages
    2k Vues
    T
    A tu fait un mod que je peux telecharger avec ? car j’en aurai besoin pour 1 PvP fac
  • Fonction gerer que par le client et non par le serveur

    Déplacé Résolu 1.12.2
    11
    0 Votes
    11 Messages
    524 Vues
    ZunF1xZ
    Okay merci!
  • Bière bug de partout

    Déplacé Résolu 1.12.2
    9
    0 Votes
    9 Messages
    510 Vues
    pazzazzoP
    super tout est fini (appart un bruit de rôt a la fin mais on l’entends pas) package com.frenchdevteam.goodlifemod.objects.items; import com.frenchdevteam.goodlifemod.GoodLife; import com.frenchdevteam.goodlifemod.init.ItemInit; import com.frenchdevteam.goodlifemod.util.interfaces.IHasModel; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.MobEffects; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; import javax.annotation.Nullable; import java.util.List; public class Beer extends ItemFood implements IHasModel { public Beer(String name, int amount, float saturation, boolean isWolfFood) { super(amount, saturation, isWolfFood); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(GoodLife.GOODLIFETAB); setAlwaysEdible(); this.setMaxStackSize(1); ItemInit.ITEMS.add(this); } @Override public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving) { entityLiving.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 300, 5, false, false)); entityLiving.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 200, 1, false, false)); super.onItemUseFinish(stack, worldIn, entityLiving); return new ItemStack(ItemInit.BOUTEILLE); } public EnumAction getItemUseAction(ItemStack stack) { return EnumAction.DRINK; } @Override public void registerModels() { GoodLife.proxy.registerItemRenderer(this, 0, "inventory"); } @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { return null; } @Override public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) { tooltip.add("à boir avec modération!"); super.addInformation(stack, worldIn, tooltip, flagIn); } }
  • Texture item ne marche pas

    Déplacé Résolu 1.12.2
    7
    0 Votes
    7 Messages
    240 Vues
    D
    Ok merci maintenant ça marche parfaitement
  • Hammer 5x5

    Déplacé Résolu 1.12.2
    6
    0 Votes
    6 Messages
    635 Vues
    robin4002R
    Oui c’est moi qui l’ai fait
  • Problème de lancement de Minecraft

    Déplacé Résolu 1.12.2
    3
    0 Votes
    3 Messages
    268 Vues
    DeansD
    Merci beaucoup le problème est régler.
  • Erreur metatdata avec "item.RegistryName()"

    Déplacé Résolu 1.12.2
    5
    0 Votes
    5 Messages
    348 Vues
    Reilov18R
    Bonjour, désolé j’ai eu quelques problèmes de pc mais j’ai finalement pu essayer vos deux techniques et celle de Eno_gamer10 a marché! Merci ^^