Tutorial - Enchantment glow on items

Started by k6u on

Topic category: User side tutorials

Last seen on 10:41, 7. Sep 2021
Joined Sep 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Tutorial - Enchantment glow on items
Sat, 11/18/2017 - 19:48 (edited)

Hello all! This is a very easy and quick tutorial on how to get an enchantment glow on blocks, tools, items, ect. Items such as the "Notch" apple, and the nether star use this code.

1. Create your mod element as usual.

2. Click on "CODE" in the top middle of the screen, then once you are inside the code editor, click on the mod element that you want to add the enchant effect to. http://prntscr.com/hbwd8j

3. Once you have clicked on the element you want to edit, a tab will open that warns you about editing code and mcreator overriding it, ect ect, just click "Lock the code for MCreator" http://prntscr.com/hbwegt

4. Now you can edit the code of your mod element. Up at the top of the code, make a space in the imports list like this; http://prntscr.com/hbwgfv

5. And put this line of code into that space; 

import net.minecraftforge.fml.relauncher.SideOnly;

It should look like this; http://prntscr.com/hbwhd7

6. If you scroll down to the bottom, you will see this section of the code; http://prntscr.com/hbwhw5. Depending on what type of mod element you have made, the code will vary. 

7. Make a space inbetween some swirly brackets, and paste this; 

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

It should now look like this; http://prntscr.com/hbwj7m

Now you are done! Save and build, launch up your game and your selected mod element should have a enchantment glow!

Here is what it looks like ingame; http://prntscr.com/hbwm1o  as you can faintly see, it has the enchantment shimmer.

If you need any help with the tutorial, just ask and I will reply soon as possible. 

I will be making more simple tutorials in the future on MCreator, if you want you can request a tutorial and I will do it.

Edited by k6u on Sat, 11/18/2017 - 19:48
Last seen on 17:49, 25. Mar 2021
Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks! :D This is very…
Sun, 11/19/2017 - 13:54

Thanks! :D This is very helpful! 

Last seen on 11:42, 20. May 2018
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Errors for me: "class,…
Mon, 02/19/2018 - 22:20

Errors for me: "class, interface or enum expected"