In Game Currency

Started by Univern on Sun, 04/08/2018 - 21:15

Topic category: Help with modding (Java Edition)

Last seen on 16:11, 20. Jul 2020
Joined Mar 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
In Game Currency
Sun, 04/08/2018 - 21:15

I want to make a money currency for my mod. I think an overlay might do the trick, but I don't know how to have the money amount go up or down; i want to make it when you kill anything you get random amounts of cash for the kill, but i don't want cash to be an item, so it doesn't fill your inventory. How would I make this? (The money currency dosen't have to be an overlay, it could be shown in the inventory)

Last seen on 20:46, 6. Sep 2019
Joined Mar 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Use a variable to keep track…
Wed, 04/11/2018 - 23:56

Use a variable to keep track of your currency.

Last seen on 16:11, 20. Jul 2020
Joined Mar 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I'm not very good with…
Tue, 04/17/2018 - 20:01

I'm not very good with variables, which one would i use? Number or string? (i don't know what string is) and if its number, how do i set the variable to add 10 cash? what i see is: [if mob killed set variable to 10], but doesn't that mean every time I kill my money is set to ten, not added ten? should i put in +10? and how will i make it so you can see your cash?

Last seen on 21:11, 2. Aug 2020
Joined Mar 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Number variables are just…
Wed, 04/18/2018 - 02:31

Number variables are just like normal variables, but can only hold numbers,

Strings can hold words and stuff,

Examples: Number: "6" String: "Six" (or "words" or even "Notice creepers are on the rise!")

how to add the currency into the game: Go into the "Variables and stuff" and make a new NUMBER Var (Variable) and enter a name, lets just say "Money" and set the default to 0. in the "global events" section in your workplace should be a "when entity is killed" add an event, find "variable set" and there should be a way to add a random amount, if not, just try and set it to 5 or 10 or how ever you want it! i know this is a little not specific, but i hope this helps!

Last seen on 14:39, 28. Oct 2020
Joined Dec 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
just make a dollar bill item…
Fri, 12/28/2018 - 23:06

just make a dollar bill item or something.

Last seen on 19:10, 28. Oct 2020
Joined Jun 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You can use variables. Numer…
Sat, 12/29/2018 - 11:19

You can use variables.

Numer variables use numbers that are ≥ 0. They can be used for things that can be counted.

Boolean variables can only be true or false. They can be used to check if something is happing/happened or not.

String variables are words. They can be something like "Hello", "12345", "Hi, I'm a variable", etc. They can be used to make in-game messages in the chat.

Mcreator also uses 3 "bonus" elements: block, item and entity. These elements can be found in the "minecraft elements" tab.

 

To make currency as a variable that should be shown in a Overlay you should use number.

Keep in mind however that global variables reset everytime you close minecraft and are shared between worlds, while local variables are local per procedure and are reset when the procedure ends (so they last 1 minecraft tick).

Since variables are quite limited at the moment, you should use items as currency.

I hope you learnt something about variables with this.

Last seen on 14:39, 28. Oct 2020
Joined Dec 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I put a message in my phone…
Sat, 12/29/2018 - 23:02

I put a message in my phone mod with a shopping app that says you should redeem all your currency to emeralds before you exit the world

Last seen on 14:39, 28. Oct 2020
Joined Dec 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
use this pseudo code to…
Sat, 12/29/2018 - 23:08

use this pseudo code to increase variables:

Set variable to : variable + (number you want to increase it by)

use this pseudo code to buy stuff:

if variable > (cost of item)

    Add an item to player's inventory

    Set variable to : variable - (cost)