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

Hello everybody, 

 

I am planning to make a mod that has a skill system as a main feature and i am not sure how to add this properly. I don´t want to mess around and just make it work, but not perfekt, it should be well done and not using forge features incorrectly. 

There will be a new kind of level and exp for the player additional with skillpoints and a skilltree.  

Are there any tips, hints, words for me or tutorials you would recommend?

 

Thanks for every answer, 

Kaneka

We cant answer everything for you but i might have a few tips.

 

First you need to define your skill system as a series of classes for instance maybe a class SkillManager to handle skills for players in the world

Second you need to define what your skills are probably a series of classes containing the skills name etc.

Third you need to be able to save and read to each Players NBT Data their skill information

Fourth each individual skill will have different ways of working most skills will probably make use of forge events so learn how to use forge events

and for individual help you can always just post topics here.

@jtsfour he should not be saving this to the player's NBT data directly, instead he should use a capability attached to the player that holds all the skill data.

10 minutes ago, XFactHD said:

@jtsfour he should not be saving this to the player's NBT data directly, instead he should use a capability attached to the player that holds all the skill data.

Why? Skill data will be very small.

Because accessing the player's NBT tag is not very clean and synchronisation is as far as I know only barely possible. If you use capabilities you can sync it yourself and accessing it is also much cleaner.

It's added by forge for Entities, ItemStacks, TileEntities and Worlds.

  • Author

I was thinking of using capabilities for the levels and experience, but are they good for making the skills? 

No, the Capability is for storing which skills the player has and what skill level they are.

 

The actual skill system can be totally separate and simply query the player's Capability when they interact with it.

 

If your skills need to store any information on a per player basis, that should be stored in the player's Capability.

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.