Tutorial - Enchantment glow on items

Started by k6u on Fri, 11/17/2017 - 23:33
Last seen on 06:40, 13. Feb 2018
Joined Sep 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
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 09:16, 24. Feb 2018
Joined Feb 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
  • developer
This is a very well made…
Sun, 11/19/2017 - 09:28

This is a very well made tutorial. Good job k6u!

Last seen on 21:58, 24. Feb 2018
Joined Jun 2016
User points:

Statistics:

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

Thanks! :D This is very helpful! 

Last seen on 23:27, 24. Feb 2018
Joined Feb 2018
User points:

Statistics:

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

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