Make a Block eatable

Discussion in 'Spigot Plugin Development' started by DJJujuVI, Jun 16, 2016.

  1. Is it possible to make a Material, Dye, or Block eatable? I want to make a plugin and I need to eat dye. Any ideas? Thanks! (I have no code so far, just wondering if this is true)
     
  2. There might be a way to send eating packets to the player. Then you would just need to take one from the itemstack amount and add some hunger bars to the player
     
  3. How would I do this? Not very good with packets.
     
  4. You can make the item move similar to the eating animation by changing it somehow (keep editing the lore with color codes).
     
  5. Hard to do. Using packets to play the eating particle will work... provided that the client understands your block to be edible. You'll have no luck with that packet if you try to force your player to eat a diamond. Speaking from experience :(
     
  6. Its possible, but hard to do...
     
  7. Maybe it's possible to hook into where blocks are "made"? It's possible to spawn custom entities by extending the NMS ones. So it might as well just be possible to extend dyes and make them eatable (maybe there's an interface like that). Only thing is, I don't know if it's all handled client side. Then it might be a bit more difficult^^