Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi, I need help:

 

I made a mod which adds Nether star armor, everything is working fine.

I added the enchantment effect (only the effect, not any enchantment!!!) to the items, worked. But now, I want to ask you how can I add this effect to the armor 'model' when I wear the armor (means: how do I add this effect that I can see that and other players too). Would be great if anyone could help me.

 

The thing is, it would be great if other modders could know that too. I googled and googled, watched videos and other stuff... but I didn't find it out for so much time.

 

Greets, FlatCrafter

ive added the enchantment effect to items using,

 

@SideOnly(Side.CLIENT)

    public boolean hasEffect(ItemStack par1ItemStack)

    {

        return true;

    }

 

with a few items like ingots and such just inside the item class, armour is made like an item and has the ability to use the effect in standard vanilla, i dont see why you cant use the method in the armour class? have you tried it

  • Author

ive added the enchantment effect to items using,

 

@SideOnly(Side.CLIENT)

    public boolean hasEffect(ItemStack par1ItemStack)

    {

        return true;

    }

 

with a few items like ingots and such just inside the item class, armour is made like an item and has the ability to use the effect in standard vanilla, i dont see why you cant use the method in the armour class? have you tried it

 

Yes I did this exactly like you, but I don't see this 'glitter/enchantment' effect at the model.

BTW, this is my NetherStarArmor class:

[spoiler=NetherStarArmor.java]

package de.cynfos.toolsplus.armor;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import de.cynfos.toolsplus.Armor;
import de.cynfos.toolsplus.ToolsPlus;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;

public class NetherStarArmor extends ItemArmor {

public NetherStarArmor(ArmorMaterial material, int ID, int placement) {
	super(material, ID, placement);
	setCreativeTab(ToolsPlus.tabToolsPlus);

	if (placement == 0) { setTextureName(ToolsPlus.MODID + ":nether_star_helmet"); }
	else if (placement == 1) { setTextureName(ToolsPlus.MODID + ":nether_star_chestplate"); }
	else if (placement == 2) { setTextureName(ToolsPlus.MODID + ":nether_star_leggings"); }
	else if (placement == 3) { setTextureName(ToolsPlus.MODID + ":nether_star_boots"); }
}

public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
	if (stack.getItem() == Armor.NetherStarHelmet || stack.getItem() == Armor.NetherStarChestplate || stack.getItem() == Armor.NetherStarBoots) {
		return ToolsPlus.MODID + ":textures/models/armor/nether_star_layer_1.png";
	}
	if (stack.getItem() == Armor.NetherStarLeggings) {
		return ToolsPlus.MODID + ":textures/models/armor/nether_star_layer_2.png";
	}
	else {
		return null;
	}
}

@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack par1ItemStack) {
	return true;
}

}

 

with the haseffect method use this because that version of hasEffect is depreciated

@SideOnly(Side.CLIENT)
    public boolean hasEffect(ItemStack par1ItemStack, int pass)
    {
        return true;
    }

  • Author

Ok guys, I solved the problem. Many thanks to all of you!

Here is my new hasEffect() method:

 

@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack par1ItemStack) {
     par1ItemStack.setTagInfo("ench", new NBTTagList());
     return true;
}

 

I have to relink to this thread on the Minecraft Forums: LINK

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.