Plz answer my questions!

Started by CloudtailRox on Tue, 07/26/2016 - 21:54

Topic category: Help with modding (Java Edition)

Last seen on 23:50, 22. Apr 2019
Joined Nov 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Plz answer my questions!
Tue, 07/26/2016 - 21:54

I have a few questions...

1. Will Mcreator for 1.7.10 ever be updated again? I use 1.7.10 because it still supports Techne and custom mobs are easier for me.

2. Is there a way to use custom techne models for weapons and armor (in 1.7.10), if so, can someone show me the code?

3. (The rest are for 1.7.10) Can you make food(well, items in general) glow?(like ench golden apple)

4. Can you make item names be colored?

5. Can you make mobs spawn other mobs?

6. How can you make a golem-type mob? (build a structure and it spawns a mob)

7. Can you make changes to already existing items?(I already asked this but I didn't understand the given answer)

8. Why in 1.7.10 are custom items just an "M" but in later versions, it shows the texture?

9. Why do ghost-mobs spawn when you use the "Spawn Entity" event?

10. My custom trees dont work, I set them to endstone but they're just regular trees in the biome. How can I fix this?

11. Some mob events (When mob attacks, When killed) aren't working for me, I set events in them lke normal, but they just don't do anything.Am I doing something wrong?

12. Can I make swords give potion effects? (When you hit a mob, the sword hives it poison)

 

These are just some questions I had, and I didn't feel like putting all into seperate posts. Bai!

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:RE:RE:RE:Did you paste it to the
Sat, 08/20/2016 - 11:42

@#7.2.1.1 The code is supossed to by in the item code itself , not in the recipe code.
And if you want have an item have enchanted in the creative inventory public void getSubItems()

Last seen on 12:58, 23. Sep 2019
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:RE:RE:RE:RE:Did you paste it to the
Sat, 08/20/2016 - 12:00

@#7.2.1.1.1 It is in the item code, I just coied the recipe with enchant code, in the sword one.

I'm gonna try out how it works that public void, ty.

About the potion effect, I don't really know how to let it work in that class :/

I found tons of similar codes for sword but it seems in MCreator it's a bit different (I guess) and I haven't found any help.

If exists a way to make a sword from item mod in mcreator, would be great, since the 1,5 thing seems to bu bugged, instead of rewrite the sword code from 0.

Last seen on 12:58, 23. Sep 2019
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:RE:RE:RE:RE:Did you paste it to the
Sat, 08/20/2016 - 12:46

@#7.2.1.1.1 Holy **** I gave you the wrong code... sry

[spoiler]

import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.common.util.EnumHelper;

import net.minecraft.world.World;
import net.minecraft.item.ItemSword;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.Minecraft;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.entity.EntityLiving;
import net.minecraft.init.Enchantments;
import net.minecraft.init.Blocks;

import java.util.Set;
import java.util.Random;
import java.util.HashMap;

public class mcreator_peste {

    public mcreator_peste() {
    }

    public static Item block;
    public static Object instance;

    public void load(FMLInitializationEvent event) {
        ItemStack stack = new ItemStack(block, 1);
        if (event.getSide() == Side.CLIENT)
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
                    .register(block, 0, new ModelResourceLocation("TestEnvironmentMod:Peste", "inventory"));
                      ItemStack recStack = new ItemStack(mcreator_peste.block, 1);
                      recStack.addEnchantment(Enchantments.SHARPNESS, 10);
                      GameRegistry.addRecipe(recStack, new Object[]{"XXX", "X4X", "XXX", Character.valueOf('4'), Blocks.EMERALD_BLOCK,});

    }

    public void generateNether(World world, Random random, int chunkX, int chunkZ) {
    }

    public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
    }

    public int addFuel(ItemStack fuel) {
        return 0;
    }

    public void serverLoad(FMLServerStartingEvent event) {
    }

    public void preInit(FMLPreInitializationEvent event) {
    }

    public void registerRenderers() {
    }

    static {
        Item.ToolMaterial enumt = EnumHelper.addToolMaterial("PESTE", 1, 100, 1F, 1, 64);
        block = (Item) (new ItemSword(enumt) {
            public Set<String> getToolClasses(ItemStack stack) {
                HashMap<String, Integer> ret = new HashMap<String, Integer>();
                ret.put("sword", 1);
                return ret.keySet();
            }
        }).setUnlocalizedName("Peste");
        GameRegistry.registerItem(block, "Peste");
        block.setCreativeTab(CreativeTabs.COMBAT);

    }

     public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
    {
        par2EntityLiving.addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("poison"), 200, 2));
        return true;
    }

}

[/spoiler]

(dunno how make "public void getsubitems etc." work D: )

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:RE:RE:RE:RE:RE:Did you paste it to the
Sat, 08/20/2016 - 12:54

@#7.2.1.1.1.2 Try:

 

[spoiler]

import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.common.util.EnumHelper;

import net.minecraft.world.World;
import net.minecraft.item.ItemSword;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.Minecraft;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.entity.EntityLiving;
import net.minecraft.init.Enchantments;
import net.minecraft.init.Blocks;

import java.util.Set;
import java.util.Random;
import java.util.HashMap;

public class mcreator_peste {

    public mcreator_peste() {
    }

    public static Item block;
    public static Object instance;

    public void load(FMLInitializationEvent event) {
        ItemStack stack = new ItemStack(block, 1);
        if (event.getSide() == Side.CLIENT)
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
                    .register(block, 0, new ModelResourceLocation("TestEnvironmentMod:Peste", "inventory"));
                      ItemStack recStack = new ItemStack(mcreator_peste.block, 1);
                      recStack.addEnchantment(Enchantments.SHARPNESS, 10);
                      GameRegistry.addRecipe(recStack, new Object[]{"XXX", "X4X", "XXX", Character.valueOf('4'), Blocks.EMERALD_BLOCK,});

    }

    public void generateNether(World world, Random random, int chunkX, int chunkZ) {
    }

    public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
    }

    public int addFuel(ItemStack fuel) {
        return 0;
    }

    public void serverLoad(FMLServerStartingEvent event) {
    }

    public void preInit(FMLPreInitializationEvent event) {
    }

    public void registerRenderers() {
    }

    static {
        Item.ToolMaterial enumt = EnumHelper.addToolMaterial("PESTE", 1, 100, 1F, 1, 64);
        block = (Item) (new ItemSword(enumt) {
            public Set<String> getToolClasses(ItemStack stack) {
                HashMap<String, Integer> ret = new HashMap<String, Integer>();
                ret.put("sword", 1);
                return ret.keySet();
            }
                 public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
    {
        par2EntityLiving.addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("poison"), 200, 2));
        return true;
    }
    @SideOnly(Side.CLIENT)
    public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)
    {
      ItemStack item = new ItemStack(itemIn, 1, 0);

      item.addEnchantment(Enchantments.SHARPNESS, 10);

        subItems.add(item);
    }
        }).setUnlocalizedName("Peste");
        GameRegistry.registerItem(block, "Peste");
        block.setCreativeTab(CreativeTabs.COMBAT);

    }

[/spoiler]

Last seen on 12:58, 23. Sep 2019
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:RE:RE:RE:RE:RE:RE:Did you paste it to the
Sat, 08/20/2016 - 13:09

@#7.2.1.1.1.2.1 Cannot find symbol class List and class SideOnly.

I tried some imports but nothing works

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:RE:RE:RE:RE:RE:RE:RE:Did you paste it to the
Sat, 08/20/2016 - 13:15

@#7.2.1.1.1.2.1.1 
Tried
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;

?

Last seen on 12:58, 23. Sep 2019
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:RE:RE:RE:RE:RE:RE:Did you paste it to the
Sat, 08/20/2016 - 13:16

@#7.2.1.1.1.2.1 OMG... I can't believe the "fix imports" button would be so helpful!

and it all works... I can't believe it's possible... WTF you monster!

Perfect pre-enchanted poisonous weapon

Really thank you

Now I only need a way to edit the sword attack speed and it's all perfect about weapons x)

 

Last seen on 12:58, 23. Sep 2019
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:RE:RE:RE:RE:RE:RE:RE:RE:Did you paste it to the
Sat, 08/20/2016 - 17:58

@#7.2.1.1.1.2.1.1.1 *** poison does not work... or better, it only works on villagers

It doesn't make sense

Still working on everyone if using an item instead of tool

Last seen on 12:58, 23. Sep 2019
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
little correction (damn forum
Sat, 08/20/2016 - 18:03

little correction (damn forum where I can't edit messagges): it works on every entityLivingBase except undead and arthropods (zombies, pigzombies, skeleton, spiders) :/

Why this weird thing?! 

Last seen on 12:58, 23. Sep 2019
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:RE:RE:RE:RE:RE:RE:RE:RE:Did you paste it to the
Sat, 08/20/2016 - 20:05

@#7.2.1.1.1.2.1.1.1 Everything solved.

except the fact that the weapon does not take damage, it has infinite uses, like the item, since the "onusetick" event seems to not work :/

Last seen on 12:58, 23. Sep 2019
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:RE:little correction (damn forum
Sat, 08/20/2016 - 21:09

@#10.1 I've found it out when I tried change poison to wither... too much mcreator today i guess

anyway, the weapon has infinite uses (like the item since it seems that the "onUseTick" event does not work and I can't find an updated way to damage the item when it hits an entity)

Do you know why? 

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Under "PotionEffect(Potion
Sat, 08/20/2016 - 21:19

Under "PotionEffect(Potion.getPotionFromResourceLocation("poison"), 200, 2));" put:
  "par1ItemStack.damageItem(1, par2EntityLivingBase); "

Last seen on 12:58, 23. Sep 2019
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:Under "PotionEffect(Potion
Sat, 08/20/2016 - 21:38

@#11 ... it's useless... I'm trying to find something that you don't know, but I always fail x)

Joking

Thank you very much man, it works perfectly