Functional Bookshelves

Functional Bookshelves 1.2.0-b1739-REL

jumpsplat120

Helper
Staff member
Helper
Jun 24, 2020
59
8
8
www.jumpsplat120.com
jumpsplat120 submitted a new resource:

Functional Bookshelves - Just a bit of light reading!

Left click on a bookshelf with a written book to place it on the shelf, or to check out a transient copy of the book, if one already exists on the shelf.

Right click on a bookshelf to view the author and title of a book.

Shift left click on a bookshelf to remove the book placed there, if you were the one who put it there. While only the original player can remove the book via shift left clicking, the book will drop automatically if the bookshelf is burned down or exploded.

Read more about this resource...
 

Sarianna

New member
Jun 12, 2021
2
0
1
I've been looking for something just like this, but I'm having a bit of trouble. If I left click a bookshelf with a written book, it says it places the book on the shelf... but it also destroys the bookshelf and automatically drops the book again. Same happens if I try to shift left click. Is there a trick to making it place books without destroying the shelves?
 

jumpsplat120

Helper
Staff member
Helper
Jun 24, 2020
59
8
8
www.jumpsplat120.com
I've been looking for something just like this, but I'm having a bit of trouble. If I left click a bookshelf with a written book, it says it places the book on the shelf... but it also destroys the bookshelf and automatically drops the book again. Same happens if I try to shift left click. Is there a trick to making it place books without destroying the shelves?
Are you in creative mode? Left clicking a block in creative mode destroys blocks.
 
  • Like
Reactions: Sarianna

Sarianna

New member
Jun 12, 2021
2
0
1
Switching to survival fixed the breaking-bookshelf issue. But now the temporary checked-out book wouldn't leave my inventory, and when I removed it from my inventory, it still kept my player flag as checked-out and won't let me check out any other books.
 

Andarius68

Member
Jul 10, 2021
7
0
1
I love this script! It's going to be so useful for quests I would like to add to my server. My only problem is that it doesn't remove books which are made with another plugin I have called Interactive Books if the books have been opened and read. It fades them away just fine if they are dropped on the ground and not read, but once they are read it no longer treats them as a temp book. Now, bear with me, I am a Denizen Scripting newb here and haven't even made it through the beginners guide all the way yet so there is still a lot I don't know. But, what I think is happening is that Interactive Books causes the item name to become Ibook rather than written_book and I think the definition line,
- define item_is_book <[item].material.name.equals[written_book]> might be the key to fixing this issue for my setup. What I don't know yet, is if it's possible to edit the definie line to say something akin to - define item_is_book <[item].material.name.equals[written_book]or[Ibook]> maybe? Perhaps there is another approach to this though? I'm not 100% certain that Ibook is the correct item name either but looking at the code on GitHub for Interactive Books leads me to believe this may be the case. In any event, this is an incredibly useful script regardless. I would just like to make it work with the Interactive Books if possible due to the portability of that book format versus the ones written in game. That way I could define a set of books which I could easily copy over from one world to another.
 

Andarius68

Member
Jul 10, 2021
7
0
1
I love this script! It's going to be so useful for quests I would like to add to my server. My only problem is that it doesn't remove books which are made with another plugin I have called Interactive Books if the books have been opened and read. It fades them away just fine if they are dropped on the ground and not read, but once they are read it no longer treats them as a temp book. Now, bear with me, I am a Denizen Scripting newb here and haven't even made it through the beginners guide all the way yet so there is still a lot I don't know. But, what I think is happening is that Interactive Books causes the item name to become Ibook rather than written_book and I think the definition line,
- define item_is_book <[item].material.name.equals[written_book]> might be the key to fixing this issue for my setup. What I don't know yet, is if it's possible to edit the definie line to say something akin to - define item_is_book <[item].material.name.equals[written_book]or[Ibook]> maybe? Perhaps there is another approach to this though? I'm not 100% certain that Ibook is the correct item name either but looking at the code on GitHub for Interactive Books leads me to believe this may be the case. In any event, this is an incredibly useful script regardless. I would just like to make it work with the Interactive Books if possible due to the portability of that book format versus the ones written in game. That way I could define a set of books which I could easily copy over from one world to another.
Ok, upon further investigation on the item names after a book is opened using Interactive Books it appears that it is still written_book and not IBook and as I make my way through the Denizen Beginners Guide I learn that definitions are for short term memory while flags are better suited to long term memory. I'm thinking now what might be happening is that when the book is opened with Interactive Books the definition is lost and that's why the book is not faded when it is dropped on the ground afterwards. Maybe if I can instead alter it to flag the item instead?
 

jumpsplat120

Helper
Staff member
Helper
Jun 24, 2020
59
8
8
www.jumpsplat120.com
Ok, upon further investigation on the item names after a book is opened using Interactive Books it appears that it is still written_book and not IBook and as I make my way through the Denizen Beginners Guide I learn that definitions are for short term memory while flags are better suited to long term memory. I'm thinking now what might be happening is that when the book is opened with Interactive Books the definition is lost and that's why the book is not faded when it is dropped on the ground afterwards. Maybe if I can instead alter it to flag the item instead?
I can't promise interoperability with third party plugins that change how vanilla mechanics work. However, the definition wouldn't be *lost*, that's not how definitions work. Having taken a look at the plugin, it's only doing stuff Denizen can already do using book script containers. Consider hoping into the discord if you have any questions on how they work. If you use book script containers, this plugin should work just fine.
 
  • Like
Reactions: Andarius68