Solved Client-side only blocks

Discussion in 'Plugin Development' started by Th3Controller, Jan 22, 2013.

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

    Th3Controller

    I'm wondering how you can make blocks only appear in client-side Minecraft.

    Meaning the block isn't really there and it wouldn't be saved in the world but its visible to the player.
     
  2. Offline

    evilmidget38

    Player#sendBlockChange(Location loc,Material material,byte data)
     
    Th3Controller likes this.
  3. Offline

    chasechocolate

    Might have to be done with packets. I guess not.
     
    Th3Controller likes this.
  4. Offline

    Th3Controller

    I'll try it out thanks.
    Same thing I was thinking :p

    Edit: Reading from the API it does have to do with packets :D

    sendBlockChange(Location loc,Material material,byte data)

    For "byte data" what should be the block's data?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  5. Offline

    Comphenix

    That's the data value of a particular block. It depends on the block ID or material.
     
    Th3Controller likes this.
  6. Offline

    Jogy34

    The data value tells you what type of that certain block it is.
    http://www.minecraftwiki.net/wiki/Data_values
     
    Th3Controller likes this.
  7. Offline

    Cjreek

    For example the color of a wool block or the orientation of a block.
    Usally for most blocks it's just (byte)0.
     
    Th3Controller likes this.
  8. Offline

    Th3Controller

    Oh alright, so if I want orange wool which has a damage value of 1 or byte data of 1 I would write so:
    sendBlockChange(playerLoc, Material.WOOL, 1)
    And if its just a normal cobblestone block it would be:
    sendBlockChange(playerLoc, Material.COBBLESTONE, 0)
     
  9. Offline

    Jogy34

    yup. that should work at least.
     
    Th3Controller likes this.
  10. Offline

    Cjreek

    You'll have to cast the data value to byte, but apart from that you're right.
     
    Th3Controller likes this.
  11. Offline

    woutboy

    Doesn't work for me, Material cannot be resolved to a variable...
     
Thread Status:
Not open for further replies.

Share This Page