Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Secret BookShelf... Allows players to craft and place secret bookshelves. They can place items in their bookshelf, and no players will no its there.
- Options:
- size: 2 # < -- Rows in the inventory when a bookshelf is opened
- on load:
- set {recipes.bookshelf} to 1 bookshelf named "&9Secret Bookshelf" with lore "&bThis is a secret bookshelf||&b you can place items into"
- register new shaped recipe for {recipes.bookshelf} using air, air, air, bookshelf, chest, bookshelf, air, air, air
- on place of a bookshelf:
- if name of player's tool contains "&9Secret Bookshelf":
- send "&9Secret bookshelf has been placed" to player
- set {secretshelf.%player%.%event-location%} to location of the event-location
- on right click:
- if location is {secretshelf.%player%.%event-location%}:
- open chest with {@size} row named "&9Secret Bookshelf" to player
- set {_chest} to 0
- set {secretshelf.%player%.templocation} to event-location
- set {_size} to {@size} * 9
- loop {_size} times:
- set slot {_chest} of player's current inventory to {secretshelf.%player%.%event-location%::%{_chest}%}
- add 1 to {_chest}
- on inventory close:
- if event-inventory's display name contains "&9Secret Bookshelf":
- set {_chest} to 0
- set {_size} to {@size} * 9
- loop {_size} times:
- set {secretshelf.%player%.%{secretshelf.%player%.templocation}%::%{_chest}%} to slot {_chest} of event-inventory
- add 1 to {_chest}
- on block break:
- if location is {secretshelf.%player%.%event-location%}:
- cancel event
- set event-block to air
- drop 1 of {recipes.bookshelf} at event-location
- set {_chest} to 0
- wait 5 ticks
- set {_size} to {@size} * 9
- loop {_size} times:
- drop {secretshelf.%player%.%event-location%::%{_chest}%} at event-location
- delete {secretshelf.%player%.%event-location%::%{_chest}%}
- add 1 to {_chest}
- delete {secretshelf.%player%.%event-location%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement