A little question.

Started by Filipvali12 on Sat, 11/12/2016 - 14:32

Topic category: Advanced modding

Last seen on 13:51, 24. Mar 2018
Joined Mar 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
A little question.
Sat, 11/12/2016 - 14:32

Hello!!
I tried to 'play' with MCreator and gave a strange little thing.
When I select "Block that drops" and select a block , and then select "Drop amount: 0" ,had item will be dropped random ?

Sorry for my English . I do not know a lot.

Last seen on 07:04, 27. Oct 2020
Joined Jun 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I think it will drop nothing
Sun, 11/13/2016 - 07:16

I think it will drop nothing or when you close the editor mcreator will automally set the drop to 1. For make sure that a block doesn't drop nothing a set air for drop. 

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
No it will not be random. For
Sun, 11/13/2016 - 08:55

No it will not be random. For random amount:
A) Take the par1Random parameter from the quantityDropped field and and use its method nextInt() in the return statement.
Result is something like:
public int quantityDropped(Random par1Random){
return 4 + par1Random.nextInt(2);
}

 

4 is the minimal drop

2 is maximal-minimal

B)Use Math.random()

For example:

public int quantityDropped(Random par1Random){
return (int)(Math.random()*10);
}

This returns random value between 0 and 10.

Last seen on 10:15, 29. Mar 2017
Joined Sep 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
cool  
Sun, 11/13/2016 - 13:00

cool