Pas d'item pour l'enchant[1.8.9]



  • Re : Faire un enchantement
    Je voudrais faire un enchant,reussi on peut se le give avec le /enchant mais pas sous forme d'item
    preInit

    	
        
        	   enchantTuto = new EnchantmentTuto().setName("enchantTuto");
        	
        	   MinecraftForge.EVENT_BUS.register(new ClasseKiGereLesEnchantementsDeDaich());
     
        	
            logger = event.getModLog(); // initialise le logger. event.getModLog() retourne un logger avec votre modid
    
            
            blockBlue = new BlockBlue(Material.rock).setUnlocalizedName("blueore").setCreativeTab(daichCreativeTabs);
          
            book = new BlockBook(Material.wood).setUnlocalizedName("bookblock").setCreativeTab(daichCreativeTabs);
            MineIF = new MineIF(Material.iron).setUnlocalizedName("mineifdm").setCreativeTab(daichCreativeTabs);
            
            GameRegistry.registerBlock(book, "book"); // .json
            GameRegistry.registerBlock(MineIF, "mineif"); // .json
    
            
            GameRegistry.registerBlock(blockBlue,"poarpo"); 
            
            
            potionblue1 = new ItemPo().setCreativeTab(CreativeTabs.tabFood).setUnlocalizedName("popo1blue");
    
            GameRegistry.registerItem(potionblue1,"popo"); 
            
            
            
            
            
            
            poison = new Fluid("poison", null, null).setDensity(690000).setViscosity(9665).setTemperature(28682).setLuminosity(19).setUnlocalizedName("ingotliquid").setGaseous(true); 
           
            FluidRegistry.registerFluid(poison); // on register notre fluid
            poison = FluidRegistry.getFluid("poison");
     
            poisenouswaterb = new BlockFluidPoison(poison, Material.lava); // on crée notre block
            GameRegistry.registerBlock(poisenouswaterb, poisenouswaterb.getUnlocalizedName().substring(5)); //puis on le register
     
    poisonbucket = new ItemBucketPoison(MoDaichMod.poisenouswaterb).setUnlocalizedName("poisonbucket").setCreativeTab(CreativeTabs.tabMisc).setContainerItem(Items.bucket);
     
    GameRegistry.registerItem(poisonbucket , "bluebucket"); // on register l'item
     
    FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("poison", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(MoDaichMod.poisonbucket), FluidContainerRegistry.EMPTY_BUCKET);
    
    
    
    
    
    StructureGenerator structureGenerator = new StructureGenerator();
    
    
    
    
    
    GameRegistry.registerWorldGenerator(structureGenerator, 0);
    
    
    
    
    
    pack = new ItemTutoJetPack(jetpack, 1).setUnlocalizedName("packjmdm").setCreativeTab(daichCreativeTabs);
    
    
    GameRegistry.registerItem(pack, "jetpack");
    
    

    Enchant

    package com.daichmff.modaichmod;
    
    import net.minecraft.enchantment.Enchantment;
    import net.minecraft.enchantment.EnumEnchantmentType;
    import net.minecraft.util.ResourceLocation;
    
    public class EnchantmentTuto extends Enchantment {
    
    	protected EnchantmentTuto() {
    		super(120, null, 0, EnumEnchantmentType.WEAPON);
    		// TODO Auto-generated constructor stub
    	}
    	public int getMaxLevel() {
    	    return 10;
    	}
    }
    
    

    merci.


Log in to reply