Set item in Item Frame Coding

Discussion in 'Spigot Plugin Development' started by BenThunder, May 8, 2015.

  1. Hi has anyone ever coded a minigame before? I haven't seen any good professional tutorials on it.
  2. Minigames are relatively simple. Just create a class to store game information and a class to manage the games. Add some event listeners and commands and boom. You got a minigame :p

    It really depends on what you want to do though.
    • Agree Agree x 3
  3. I hear alot of people saying that it's hard to make a minigame plugin but, It's the same as coding any other plugin...
  4. Its "hard" because it requires basic Java knowledge ;)

    Though larger gamemodes are a bit harder to make.
    • Like Like x 1
  5. OK here is what I want to make
  6. Lol, I can make that xD
  7. Yeah I dont know how to make the item frames though so can you help me?
  8. Ow yeah, that I do not know. Erm...
  9. But I am not paying 150 for it when i can make it myself
  10. Couldnt you get the location of the item frame and do this?

    Code (Text):
    ItemFrame itemFrame = (ItemFrame)world.spawnEntity(LOCATION_HERE, EntityType.ITEM_FRAME);
    itemFrame.setItem(new ItemStack(Material.APPLE);
  11. I might go and help you in a sec.
  12. Ok how would I get the loc of the item frame using this?
  13. Maybe save the players location in the config then get the block at that location and set the location of the block as the itemframe...
  14. Ok I have been looking at a few minigame tutorials on how to set up and I would like where I would type like /lab setslot 1 for a command (I know how to do that) while looking at an itemframe but I don't know how that would work. Would I use vector angles or player view?

    EDIT: It would make it a little easier for me because the server staff hasn't build the map yet
  15. I believe you can check if the ItemFrame entity is in the player's target cursor thing.
  16. I do have or know the code but, I've just installed windows 10 and setting up all my programs. So ill have to provide you with the code when i've done.
  17. I'm pretty sure that wont work...