Hello How to check the data from hitblock? if (hitBlock.getType() == Material.STAINED_CLAY) { hitBlock.setData((byte) 4); I got this but this is to set, How to get the data?
ArthurHoeke You should probably learn Java before continuing. Code:java if(hitBlock.getType().getData() == 4) {//Do stuff}
Ad237 Dont works, I need to have this above, if (hitBlock.getType() == Material.STAINED_CLAY) { And than the check if it is red. So i did this; hitBlock.getType().getData() == 4); But dont works.
Your problem is with Bytes. "hitBlock.getType().getDate()" returns a Byte but "4" is an integer. You need to do the following: Code: if (hitBlock.getType.getData == (Byte) 4) { //Code }
ArthurHoeke If something doesn't work, check first if you can find the problem yourself! Code:java byte Byte = (byte) 4; if (hitBlock.getData() == Byte) { //Code }