Development Assistance problems with casting a chest ftom getstate

Discussion in 'Plugin Help/Development/Requests' started by Tiliondc, Dec 21, 2014.

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

    Tiliondc

    Im trying to do
    Chest chest = (Chest) block.getState ()
    But im getting an illegalcastingexception.

    Is this not how you do it in version 1.8?

    Im sorry but i dont have my code. I can paste it when i get home but this problem has been bugging me all the time since i left from home.
     
  2. Offline

    Skionz

    Did you check if the Blocks state was a Chest?
     
  3. Offline

    Tiliondc

    Do i need to check if its a blockstate before i can actually cast it from blockstate? Im trying to set a block to chest and fill it from a command.
     
  4. Offline

    mythbusterma

    @Tiliondc

    Well then set the block type, then cast it from the new Block.
     
  5. Offline

    Tiliondc

    I have set the blocktype. To chest and is a single chest

    I solved it. Sorry if this post was completly redundant

    EDIT by Timtower: merged posts
     
    Last edited by a moderator: Dec 22, 2014
Thread Status:
Not open for further replies.

Share This Page