A little question.

Started by Filipvali12 on

Topic category: Advanced modding

Joined Mar 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
A little question.

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.

Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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. 

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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.