Advertisement
Yando

Untitled

Mar 1st, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. #Secret BookShelf... Allows players to craft and place secret bookshelves. They can place items in their bookshelf, and no players will no its there.
  2.  
  3. Options:
  4. size: 2 # < -- Rows in the inventory when a bookshelf is opened
  5.  
  6. on load:
  7. set {recipes.bookshelf} to 1 bookshelf named "&9Secret Bookshelf" with lore "&bThis is a secret bookshelf||&b you can place items into"
  8. register new shaped recipe for {recipes.bookshelf} using air, air, air, bookshelf, chest, bookshelf, air, air, air
  9.  
  10. on place of a bookshelf:
  11. if name of player's tool contains "&9Secret Bookshelf":
  12. send "&9Secret bookshelf has been placed" to player
  13. set {secretshelf.%player%.%event-location%} to location of the event-location
  14.  
  15. on right click:
  16. if location is {secretshelf.%player%.%event-location%}:
  17. open chest with {@size} row named "&9Secret Bookshelf" to player
  18. set {_chest} to 0
  19. set {secretshelf.%player%.templocation} to event-location
  20. set {_size} to {@size} * 9
  21. loop {_size} times:
  22. set slot {_chest} of player's current inventory to {secretshelf.%player%.%event-location%::%{_chest}%}
  23. add 1 to {_chest}
  24.  
  25. on inventory close:
  26. if event-inventory's display name contains "&9Secret Bookshelf":
  27. set {_chest} to 0
  28. set {_size} to {@size} * 9
  29. loop {_size} times:
  30. set {secretshelf.%player%.%{secretshelf.%player%.templocation}%::%{_chest}%} to slot {_chest} of event-inventory
  31. add 1 to {_chest}
  32.  
  33. on block break:
  34. if location is {secretshelf.%player%.%event-location%}:
  35. cancel event
  36. set event-block to air
  37. drop 1 of {recipes.bookshelf} at event-location
  38. set {_chest} to 0
  39. wait 5 ticks
  40. set {_size} to {@size} * 9
  41. loop {_size} times:
  42. drop {secretshelf.%player%.%event-location%::%{_chest}%} at event-location
  43. delete {secretshelf.%player%.%event-location%::%{_chest}%}
  44. add 1 to {_chest}
  45. delete {secretshelf.%player%.%event-location%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement