Solved Setting Material Type in Constructor 'MaterialAndData'

Discussion in 'Spigot Plugin Development' started by floory565, Jun 9, 2016.

Thread Status:
Not open for further replies.
  1. floory565

    Moderator

    Hi,

    I'm trying to set the constructor of MaterialAndData to birch log (ID: 17:2).

    This is what I've tried:
    Code (Text):
    MaterialAndData(Material.LOG, 2)
    but that doesn't work.

    Anyone know what to do?

    Edit: Forgot to put (byte) in front of the integer.
     
    #1 floory565, Jun 9, 2016
    Last edited: Jun 9, 2016
  2. The reason why you need to do a byte is that the data value is in bytes. Of course. If it's an int then it's the amount of items.

    If it's solved then please mark it as solved
     
  3. floory565

    Moderator

    Thanks.
     
Thread Status:
Not open for further replies.