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

What code do i use to add the echnatment Glitter to an item.

This is how i have setup my Titanites Code "Upgrade materials"

http://prntscr.com/3zi061

 

Note:

The only item i want with the glow is the "TwinkleTitanite"

A screenshot of text code? Interesting ...

 

Anyway, a quick and dirty way would be to add an enchantment to the item through an NBTTagCompound with the key "ench".

 

Alternatively, I guess you could set up a custom item renderer.

 

In that case, this is the raw code for the vanilla item glint (not glitter, that is something entirely different :P):

There are not enough hours in the day for the amount of Karma I want to give you, diesieben07!

  • Author

There are not enough hours in the day for the amount of Karma I want to give you, diesieben07!

 

I tried but it gives me error

You tried to give diesieben07 karma as well? Interesting!

 

I assume your reply was meant for diesieben07. In that case, please be more elaborate than just saying "it gives me error".

 

Specify what the error message says, and paste the relevant code - in this case, at least the

hasEffect

override you perform, and preferably the entire class.

  • Author

No not karma, i meant the hasEffect overdirve is what give me an error

You tried to give diesieben07 karma as well? Interesting!

 

I assume your reply was meant for diesieben07. In that case, please be more elaborate than just saying "it gives me error".

 

Specify what the error message says, and paste the relevant code - in this case, at least the

hasEffect

override you perform, and preferably the entire class.

Specify what the error message says, and paste the relevant code - in this case, at least the
hasEffect

override you perform, and preferably the entire class.

Lucky for you, you didn't crop that screenshot perfectly.

 

I can tell you are calling

GameRegistry.registerItem

on the line above, meaning you are trying to define a method inside a method. That will not work - unless you go through some hoops or are using Java 8, which Forge (and possibly Minecraft) will not support yet.

 

You must be new to this. I suggest reading some guides on how to program in Java and in general.

 

For the time being, though, you can just move the

hasEffect

declaration/defintion out of what I assume to be the

preinit

method of your main mod class (what is it doing there?), into the base of a new class you make called

ItemTwinkleTitanite

, which you extend from

Item

.

 

It is in this class that you will want to @Override the

hasEffect

method, simply by defining it and adding

@Override

on the line above the signature, as you have already done in your screenshot.

Try following a tutorial on how to add Items to the game. Your classes and methods are all over the place.

 

Also, please start pasting code (preferably as gists) instead of screenshotting, and please paste entire classes. If those are your entire classes, start from scratch and follow a tutorial on basic modding :)

Ah, right, thank you.

 

A lot of the classes referenced are not in the repository, though - and as such, I cannot view them.

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.