• S'inscrire
    • Se connecter
    • Recherche
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes

    Problème de spawner

    Sans suite
    1.7.x
    2
    2
    1289
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • Antoine_
      Antoine_ dernière édition par

      Bonsoir j’ai créer un spawner de mob pour mon mods mais j’ai un soucis:

      Je ne sais pas pourquoi mais le seul mob qui apparaît dans mon spawner et le COCHON.

      
      public class Spawnerherbe extends BlockContainer
      {
      private static final String __OBFID = "CL_00000269";
      
      public Spawner(Material material)
      {
      super(material);
      }
      private IIcon top,bottom;
      
      public void registerBlockIcons(IIconRegister iiconRegister)
      {
      this.blockIcon = iiconRegister.registerIcon("Modid:spawner");
      this.top = iiconRegister.registerIcon("Modid:herbe");
      this.bottom = iiconRegister.registerIcon("Modid:spawner");
      }
      public IIcon getIcon(int side, int metadata)
      {
      if(side == 0)
      return this.bottom;
      else if(side == 1)
      return this.top;
      return this.blockIcon;
      }
      public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
      {
      return new TileEntityMobSpawner();
      }
      
      public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
      {
      return null;
      }
      
      /**
      * Returns the quantity of items to drop on block destruction.
      */
      public int quantityDropped(Random p_149745_1_)
      {
      return 0;
      }
      
      /**
      * Drops the block items with a specified chance of dropping the specified items
      */
      public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
      {
      super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
      }
      
      private Random rand = new Random();
      @Override
      public int getExpDrop(IBlockAccess world, int metadata, int fortune)
      {
      return 15 + rand.nextInt(15) + rand.nextInt(15);
      }
      
      /**
      * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
      * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
      */
      public boolean isOpaqueCube()
      {
      return false;
      }
      
      /**
      * Gets an item for the block being called on. Args: world, x, y, z
      */
      @SideOnly(Side.CLIENT)
      public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_)
      {
      return Item.getItemById(0);
      }
      }
      
      

      Je ne trouve pas ou choisir le mobs j’ai fait des test mais rien de concluant merci d’avance

      1 réponse Dernière réponse Répondre Citer 0
      • robin4002
        robin4002 Moddeurs confirmés Rédacteurs Administrateurs dernière édition par

        return new TileEntityMobSpawner();

        Dans le Tile Entity.
        D’ailleurs tu n’as théoriquement pas besoin de créer un nouveau mod spawner, celui de base devrait prendre en compte le tient (il faut juste lui mettre l’id de ton mob dans le tag nbt de l’entité de bloc).

        1 réponse Dernière réponse Répondre Citer 0
        • 1 / 1
        • Premier message
          Dernier message
        Design by Woryk
        Contact / Mentions Légales

        MINECRAFT FORGE FRANCE © 2018

        Powered by NodeBB