Admin spell books
A command utility used to create command books (spell books) Its helpful for admins on survival worlds. I use it to spawn and kill player bot in standard locations at farms, but the its not limited to that usecase.
/spellbook <book> set <title> <"command">
/spellbook farms set "spawn slime farm bot" "/execute in overworld run player SlimeBot spawn at -50.50 82 24"
/spellbook farms set "kill slime farm bot" "/player SlimeBot kill"
/spellbook farms give
This will generate a book with clickable text that runs the above commands. Spell books placed in lecterns will automatically update to new versions of the spell book when opened.
Looks cool, I'll test it when I get some time. For now, how about adding a hover message to the command? You could do that either in the same command (/spellbook <book> set <title> <"command"> [<hover_text>]) or in a separate one (/spellbook <book> set <title> <"hover">, will fail if title has not been created yet). I'd suggest the default hover test is just the command, so people cna see stuff like what coords the bot is spawned at and such.
For anyone who has already done some testing with this script, run this command to migrate the book files from the app root to app/books
/script in spellbook invoke migrate_books_folder_location()
So turns out there is still some breaking changes I want to make. I intend to use a migrate function like I did earlier but I think it would be cleaner to hold off on merging/ reviewing this until I make those changes.
Also I moved the app from survival into utilities. I think the readme descriptions for the survival apps are very helpful. I would not mind including a description for this app in the utilities readme but that does not appear to be standard practice.
ok I am happy with where this app is at now and I am done making changes.
If you have existing spellbooks and want to test the updated version you can run /script in spellbook invoke migrate_spells_data_structure to migrate your old spells up to this version
This is the spellbook description to be added to the utilities readme when its ready.
spellbook.sc:
By Opsaaaaa
A in game utility for creating, using, and updating command books (spellbooks)
You create a new spell in a book with this command
`/spellbook <book> set <spell> </command>`
`/spellbook cat_spells set "spawn cat" /summon cat`
You can continue adding spells to existing spellbooks.
`/spellbook cat_spells set "spawn Tabby" /summon cat ~ ~ ~ {CatType:2}`
Then you can give yourself a copy of the spellbook with the spellbook give command,
`/spellbook cat_spells give`
Any changes you make to your spells will automatically update your spellbook when opened.
You can find more info in-game with the help command',
`/spellbook help <page>' Pages: `(main), basics, shorthands, customize, commands`
@altrisi Thank, yeah I thought it was handy.
what would you think of the command ref suggesting the command on click?
I'm honestly not quite totally sure what you mean. Tho it's been awhile since I touched the app.
I felt like some actions were being added to all books
So there is a feature that syncs spellbook with the same name. Perhaps I failed to make that clear anywhere. /spellbook farms bot ... adds the new spell to the global spellbook titled farms.
All of the other farms spell books in the world, when opened will automatically update with the new spell. So to keep spell sets separate you can use different titles. 'farms' 'warps' and so on.
The use case at the time, I hade a bunch of players on the server who liked to build afk farms. And so I wanted to give all the players a way to easily turn off other people farms when causing lag. And then have the farm owner not get annoyed about traveling to the farm any time he wanted to turn it back on. So everyone had the same synced farms spellbook.
However if you mean that some actions applied to both the "farms" and "warps" spellbooks, that would be somewhat odd. but if you saw that it could certainly be a bug.
Quite sure it was after adding to differently named books (I noticed and liked a lot the updating feature). I'll try to make some better repro steps later, maybe I did something wrong.
With the suggestions I mean that when you click a command in the help menu for example, it writes it into your chat box so you can start using it already, just a small thing I thought would be nice at the start.
Aww yes that would be nice. I think that can be an addition after the app is merged tho.
Idk why this wasn't merged already having the 2 reviews