how can you make a skill system.

Started by Shoni2009 on Sat, 05/30/2020 - 18:23

Topic category: Advanced modding

Last seen on 20:57, 22. Jun 2020
Joined Mar 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
how can you make a skill system.
Wed, 06/03/2020 - 10:25 (edited)

So in my mod i want to create a system that shows a variable i call skill to show the player how much skill they have how is this possible please help if you know.

Edited by Shoni2009 on Wed, 06/03/2020 - 10:25
Last seen on 02:08, 5. Jul 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
it's so easy hint: not…
Sat, 05/30/2020 - 18:35

it's so easy

hint: not variable

Last seen on 00:43, 1. Jul 2020
Joined Aug 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
You should've used a…
Sat, 05/30/2020 - 19:24

You should've used a question mark instead, cause it's a question how you can make a kill system

Last seen on 20:57, 22. Jun 2020
Joined Mar 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
I figured out on discord…
Sun, 05/31/2020 - 03:19

I figured out on discord server it is NBT value

 

Last seen on 12:30, 4. Jul 2020
Joined Sep 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
Well you have two options,…
Sun, 05/31/2020 - 03:26

Well you have two options, and you are going to prefer 1. Note that I PREFER OPTION 2, BUT THAT IS MY OPINION:

Option 1: In MCreator, there are Gloabal Variables and NBT variables and each are unique to the player. When using GLOBAL_SESSION along with NBT tags you can create a variable that "stays with" among death and etc.

Option 2: You can code a player's Capability. You can read about Capabilities in the link I provided below but I will summarize it in steps. First, create an interface. Then implement the interface and create all of the methods you desire. Then you attach it to the player (I may be missing something so check the link). But that is basically it. 

 

PROS OF OPTION 1:

  •  NO CODE NECESSARY! Everything involved in the process is applicable in MCreator
  • Easy to access NBT and Global variables
  • Easy to learn and create

PROS OF OPTION 2:

  • A LOT MORE FUNCTIONALITY! You can create as many methods you desire. For example, I created a method that sets a LivingEntity variable that can not be created with MCreator. In MCreator, I believe there are only boolean, int, and String variables.
  • MORE CONTROL! You are coding the capability so you obviously get more control, MCreator can't do everything. But one day it might :D
  • More compatibility with Vanilla Minecraft. I'll give you more context to what I said above. With the Capability system, I created a method that gets the entity registry name from an entity. Stores the entity registry name in a variable. And then in LivingSetAttackTargetEvent. I get the player's variable that has the entity registry name, I compare the player's variable with the entity that is attacking the players. And if they match up, I set AttackTarget(null) and setAggroed(false).

 

All in all, it is up to you but I laid out 2 options, THESE ARE NOT THE ONLY OPTIONS BUT TWO I RECOGNIZE AS APPLICABLE TO YOUR SITUATION.

 

More on Capabilities here @ https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/

Last seen on 12:00, 7. Jun 2020
Joined Aug 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
just saying that global…
Sun, 05/31/2020 - 07:05

just saying that global variables aren't multiplayer friendly so i recommend you don't listen to that guy above me (im talkin bout you @tbroski)

Last seen on 12:30, 4. Jul 2020
Joined Sep 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
@leonex. First of all, this…
Sun, 05/31/2020 - 15:39

@leonex. First of all, this isn't a chat room so only post if you have any idea of how to do what they are asking (it seems like you don't lol). Do you not realize I posted two options and can you read that I prefer option two, NOT USING GLOBAL VARIABLES. And do you also realize that Global Variables are the only way you can do this in MCreator without code... Your post made me laugh.

Last seen on 02:08, 5. Jul 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
calm down ur all so wrong…
Sun, 05/31/2020 - 15:48

calm down ur all so wrong

don't post misleading info if you don't actually know.

Don’t use nbt nor world tags, they reset after a single session

Use the advancements system or check out my Procedure Collection

There is a procedure about restoring the NBT tags after the started a new session.

 

Last seen on 12:30, 4. Jul 2020
Joined Sep 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
THE BEST WAY IS CAPABILITIES…
Sun, 05/31/2020 - 16:01

THE BEST WAY IS CAPABILITIES, ALL CAPABILITIES NEED IS TO COPY OVER IN THE PLAYER.CLONE EVENT. BUT YOU NEED TO CODE AS I SAID IN MY POST.

AND WHAT??? YOU SAY, "Don’t use nbt nor world tags" BUT THEN SAY, "There is a procedure about restoring the NBT tags". HOW DO YOU SAY "DON'T USE NBT" BUT THEN USE THEM... BUT TO THE POINT, CAPABILITIES ARE THE RECOGNIZED SYSTEM BY FORGE AND YOU WILL GET THE MOST HELP IF YOU EVER GET ISSUES WHEN POSTING TO MINECRAFT FORUMS ETC. BUT IF YOU READ MY POST AND THE LINK YOU WOULD UNDERSTAND. 

Sorry if that seemed very emphasized bt it should be. When people combat a post but don't research what the post is about, those people seem very arrogant. Your post is vague but I appreciate the help, and I am sure your "procedure" is great? I just don't like how you say Capabilities are not the best way. To prove that look at any Minecraft forums and tell me if you see your "procedure" lmao. These are in caps for boldness and emphasis. Before you respond click on the link and you will see the fUnCtIoNaLiTy.

Last seen on 02:08, 5. Jul 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
again calm down i was trying…
Sun, 05/31/2020 - 16:11

again calm down

i was trying to be nice to the new folks here unlike you

yes i agree but The Capability System are more advanced for beginners don't you agree there

we are not Minecraft forums if you wish to leave here don't argue

I sure you are remarkably smart and is the only few who used the capabilities system

The point of procedures is to hide the nasty java code for the newer users

Instead you should just leave here instead of sounding like a dog braking from your texts.

Last seen on 02:08, 5. Jul 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
also all caps make you sound…
Sun, 05/31/2020 - 16:18

also all caps make you sound very obnoxious 

Last seen on 12:30, 4. Jul 2020
Joined Sep 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
Like I said before this is…
Sun, 05/31/2020 - 16:28

Like I said before this is not a chat room. But I didn't abide by that either and I am sorry. We shouldn't be bickering over stupid code when MCreator's goal is to form a community and I fully support that. I started on MCreator so that is why I am here. Sorry if I seem obnoxious, I don't want to be because this is the forum that started me off. I hope you understand and recognize my apology. That being said, I will try not to combat a post lol. Especially from you because you recognized my post. But leonex's post was uncalled for and wasn't helpful because he didn't acknowledge Option 2 (even if Option 1 was wrong) and didn't make a recommendation to fix my post if I made an error. But you did and I fully respect you for that!

 

"Just saying that global variables aren't multiplayer friendly so i recommend you don't listen to that guy above me (im talkin bout you @tbroski)"