Variable help

Started by Modman5 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Variable help

So i am currently making a casino mod for 1.10 and i made an item "Lottery ticket". how do i make it so when i right click it rolls a random number between 1 and 50 and if that numver is 15 it gives the player who right clicked 10 diamond blocks? or is that impossible by mcreator standards??? i did see a tag for "when item is right-clicked in air" and it said execute variable but when ever i click that it says "no variables detected"?

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For random number : (int)
Sun, 12/25/2016 - 23:44

For random number : (int)(Math.random() * 50)
For detecting the value if(YOUR_VARIABLE == 15)

Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thanks (insert smily face
Sun, 12/25/2016 - 23:46

thanks (insert smily face here)

 

Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also which category do i add
Mon, 12/26/2016 - 00:02

also which category do i add these to...custom code???

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In case use mcreator's eventy
Mon, 12/26/2016 - 00:42

In case use mcreator's eventy system you can simply use something like "add item to inventory" and use as a condition (int)(Math.random() * 50) == 15