Git Product home page Git Product logo

random-item-giver-datapack's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

einfxchmxrvin

random-item-giver-datapack's Issues

Improve ingame help menu

The ingame help menu does currently not contain anything useful, just some basic information. It could be improved with some general information and an FAQ on how to use/install the datapack for example and solutions for common issues.

Here's an idea of how the menu could be structured:

Help
╠ General Overview
║ ╚ General overview of what the datapack does
╠ Settings
║ ╚ A list of how to change the most common settings like timer and item categories
╠ Common Issues
║ ╚ Issues like version incompatibility, wrong folder, etc.
╚ Installation on Server
___╚ Where to install the datapack on a server

Keypad for setting custom timer

While it's currently entirely possible to set a custom timer, both using the given options to add/remove seconds as well as just using the scoreboard command manually, it would be cool to have some sort of keypad to set a custom timer. Should theoretically be possible. You'd have 10 buttons, 1 for each number, as well as a button to confirm and backspace. The numbers would go into variables. When confirming, the numbers would be multiplied and added to form the correct output. Once again, this is not really something the datapack really needs or something that's important, more of a personal challenge. Could be added to the datapack soon, maybe not, maybe never.

Version 1.4.2

This version aims to be a big Quality of Life (QoL) update that adds a bunch of useful new settings to the datapack. Additionally, with the planned update to 1.20.2 the Random Number Generator by CloudWolf will be replaced with the new /random command.

  • 'Reset to default settings' button
  • Options to toggle more loot tables like enchanted books, potions etc.
  • More custom sounds for receiving item
  • Option to have random time between getting an item
  • Item timer in boss bar
  • Potentially rewrite some loot table

Remove the special loot tables and make one loot table for normal items, one for command blocks, one for spawn eggs and one for other creative-only items

  • Implement new random number generator
  • Update to 1.20.2 (pack format 18)
  • Remove duplicates
  • Add option to disable datapack for individual players
  • Fix some typos
  • Make back button in item settings menu go back to normal settings menu

1.4.0-Beta9

The newly added painting variants will be moved to their own loot table, as they appear way too often.

  • Move paintings to painting loot table
  • Fix typos and grammatical errors

Fix everyone receiving the same type of item

Currently, while everyone receives a random item when playing multiplayer, they always get the same type. If a normal item is rolled, everyone gets a random normal item at the same time. When a goat horn is rolled, a everyone receives a random goat horn.
It should theoretically be possible to make everyone receive a random type of item. By rolling the random number for each person seperately and not for the RandomItemGiver in general, everyone gets a random item from a random loot table.

Snapshot 24w09a NBT Changes

Edit 25.03.2024: Just found out that components are way bigger of a change, see comment below.

The recent snapshot 24w09a broke the entire datapack by randomly changing how NBT tags are formatted. This was done for "Performance improvements" and to make it more reliable in the future, but I don't really see how these changes are anything but annoying. Anyways, basically all loot tables that have NBT tags for their items need to be redone, so here`s a list of what changed in each loot table:

command_blocks.json: No changes
enchanted_books.json: {StoredEnchantments:[{id:bane_of_arthropods,lvl:1}]} => stored_enchantments={levels:{'minecraft:bane_of_arthropods':1}}
goat_horns.json: {instrument:"minecraft:ponder_goat_horn"} => instrument='minecraft:ponder_goat_horn'
lingering_potions.json: {Potion:"minecraft:strength"} => potion_contents={potion:'minecraft:strength'}
normal_items.json: No changes
other_items.json: No changes
paintings.json: {EntityTag:{variant:"minecraft:alban"}} => entity_data={variant:'minecraft:alban'}
potions.json: {Potion:"minecraft:strength"} => potion_contents={potion:'minecraft:strength'}
spawn_eggs.json: No changes
splash_potions.json: {Potion:"minecraft:strength"} => potion_contents={potion:'minecraft:strength'}
suspicious_stews.json: {Effects:[{EffectId:8,EffectDuration:120}]} => suspicious_stew=[{id:'minecraft:jump_boost',duration:120}]
tipped_arrows.json: {Potion:"minecraft:strength"} => potion_contents={potion:'minecraft:strength'}

As you can probably see, all of these changes are pretty small and only affect formatting, yet they require rewriting a bunch of code. FOrtunately, because these changes are all quite similar, they can be done using a script/tool, which takes the values out of the old tags and puts them into the new ones. I will soon provide a tool which can be used to update existing datapacks to the 24w09a changes. Please note that this tool will most likely only work with datapack made for 1.20.4+ because of the structure.

To-Do for RIG Snapshot 24w09a Updater Software:

  • Fix final issues and exceptions
  • Improve completion message
  • Add about window
  • Add notice which datapacks it works best with
  • Finalize AssemblyInfo
  • Add comments
  • Upload both exe file and code to RIG repository, under a new folder "tools"
  • Fix paintings not being converted correctly

[Skyblock] Quick Start Kit not working on servers without OP

When using the Random Item Giver Skyblock Map on a server you need OP to claim the quick start kit. This is fine if you're just playing with some friends but when playing with people you don't know/trust, for example when doing bigger projects or on public servers, giving everyone op is not possible.

There is a /trigger command which somehow let's you run functions without OP. Not sure how it works but I'm gonna look into implementing it.

Version 1.4.1

This version aims to add new features to the datapack by giving commands blocks a use and including better support for the new Random Item Giver Updater app.

  • Rename several loot table folders to include the digit 0 at the beginning
  • Add some lines as an identifier for version and mc version
  • Remove beta label

Version 1.3.2 and 1.0.20

This version will be released for 1.19 to 1.19.2 and 1.16.2 to 1.16.5

  • Fix typo Planetminecraft (should be Planet Minecraft)
  • Hide "X commands have been executed" message when clicking a button
  • Add option to get a random amount of items (between 1 and 64)
  • Recode Random Number Generator

And additionally...

  • Backport to 1.16

Version 1.4.6

This small update will raise the datapack version to assure compatibility with 1.20.5. It also replaces all NBT tags with Item Stack Components.

  • Raise pack format to 1.20.5
  • Replace NBT tags with Item Stack Components
  • Add Armadillo Spawn Egg, Armadillo Scutes and Wolf Armor

This update will of course feature everything added in 1.4.5. This will basically be a port, nothing more.

Bossbar seconds in timer

The bossbar does not currently show how many seconds are left until you get an item. Would be a neat feature.

Version 1.4.5

This version will add some improvements to the datapack to improve compatibility, as well as fix some important issues. All these features will also be gradually added to the 1.21 version.

  • Rename all objectives and add "rig_" as a prefix

Because the objective names are currently very generic, other datapacks might also use the same ones and thus cause issues. To avoid this, I'll make them unique by adding a prefix

  • Update help.txt, credits.txt and information.txt

All of these files are in desperate need of grammar and spelling fixes as I've written them a while ago when I wasn't very good at English. Some information in those files is also quite outdated. By updating them, they'll be easier to understand and provide clearer information.

- [ ] Add support for 1.20.5

This update will still target 1.20.4 as I think that this version of MC may be in use for longer because of it being the last version to support NBT

  • Fix several spawn eggs appearing in "normal" loot table
  • Credit Monarchia for making me aware of the spawn eggs being in the main loot table
  • Rename cases of "Plop Sound" to "Sound Effect"
  • (1.21 only) Fix #12
  • Fix #13
  • Fix #14

Edit: Variable change seems to break things, need to look into that

  • Fix variable change breaking pack

Suspicious stews with NBT not working

While playing 1.4.4 for 1.20.4 on multiplayer I noticed that none of the items with NBT are working. Even though NBT is being replaced I should still look into it.

Actually: So far only suspicious stews seem affected.

Version 1.0.22 & 1.3.4

This update will be released for 1.16 and 1.19. It will fix few typos and grammatical mistakes that occur throughout the datapack menus.

  • Fix typos and grammatical mistakes

Version Compatibility Detection

Ever since the release of the datapack, the most common issue was version mismatch. MC has this issue, where it won't load any loot tables that contain items that do not exist in the version. Until this gets hopefully fixed someday (Doesn't seem to be that big of an issue, just ignore the items that don't exist and load the rest?) the issue will persist. This issue is unfortunately not obvious to the user, as they still see the UI but don't get any items. I've always wanted to add some kind of version checker to the datapack, but there's pretty much no way to check the MC version from the datapack - or is there?

I've come up with an idea on how to check for the version. It's unfortunately a pretty primitive check and needs to be adapted manually for each version, but that shouldn't be that big of a deal. Here's how it works. There will be 2 new variables: rig_CheckedCompatibility (resets to 0 when reloading) and rig_VersionCheck (also resets to 0 every reload). The compatibility check will be run of the timer would give it's first item and if rig_CheckedCompatibility is 0:

In main.mcfunction:

execute if score RandomItemGiver rig_GiveItemNow matches 1 if score RandomItemGiver rig_GiveItems matches 2 if score RandomItemGiver rig_CheckedCompatibility matches 0 run function randomitemgiver:compatibilitychecker

In reload.mcfunction:

scoreboard objectives add rig_CheckedCompatibility dummy
scoreboard objectives add rig_VersionCheck dummy
...
scoreboard players set RandomItemGiver rig_CheckedCompatibility 0
scoreboard players set RandomItemGiver rig_VersionCheck 0

The check itself is pretty straight forward. First, it places a chest at 0 255 0 and inserts an item that only exists in 1.16 and above. It then uses a command to check whether the chest contains an item. If it does, that means that we are in 1.16 or above, it adds 1 score to rig_VersionCheck. If not, we have found a compatibility issue. After that, it deletes the chest.
We will repeat this to narrow down the version. The process gets repeated, but with a 1.17-only item. Once again, if the item is in the chest, we are 1.17 or above and we add 1 more to the score rig_VersionCheck which would now be 2. If not, compatibility issue.
This will be repeated until were in the most recent version. After all checks are done the pack will check the score of rig_VersionCheck. If it's 0, we know that it failed the 1.16 check and the game must be running in 1.15 or below. If it's one, we know it failed at 1.17, it it's 2 it failed at 1.18 and so on. The user will then receive a version showing the version the game was diagnosed to be running and the version the datapack was made for. There might also possibly be a link to a fitting version of the pack (If available).

The items for the versions would be stored in seperate loot tables, as using direct commands would break the whole mcfunction file. All in all, this would probably look like this:

compatibilitychecker.mcfunction

#Disable Command Block feedback to hide 'Executed commands from function' message and schedule enabling it again
gamerule sendCommandFeedback false
schedule function randomitemgiver:reset_feedback 1t

#Check for 1.16
setblock 0 255 0 chest
loot insert 0 255 0 loot randomitemgiver:compatibilitycheck/1-16
execute if data block 0 255 0 Items[{Count:1b}] run scoreboard players add RandomItemGiver rig_VersionCheck 1
setblock 0 255 0 air

#Check for 1.17
setblock 0 255 0 chest
loot insert 0 255 0 loot randomitemgiver:compatibilitycheck/1-17
execute if data block 0 255 0 Items[{Count:1b}] run scoreboard players add RandomItemGiver rig_VersionCheck 1
setblock 0 255 0 air

#Check for 1.18
setblock 0 255 0 chest
loot insert 0 255 0 loot randomitemgiver:compatibilitycheck/1-18
execute if data block 0 255 0 Items[{Count:1b}] run scoreboard players add RandomItemGiver rig_VersionCheck 1
setblock 0 255 0 air

#Check for 1.19
setblock 0 255 0 chest
loot insert 0 255 0 loot randomitemgiver:compatibilitycheck/1-19
execute if data block 0 255 0 Items[{Count:1b}] run scoreboard players add RandomItemGiver rig_VersionCheck 1
setblock 0 255 0 air

#Check for 1.20
setblock 0 255 0 chest
loot insert 0 255 0 loot randomitemgiver:compatibilitycheck/1-20
execute if data block 0 255 0 Items[{Count:1b}] run scoreboard players add RandomItemGiver rig_VersionCheck 1
setblock 0 255 0 air

#Check final result
execute if score RandomItemGiver rig_VersionCheck matches 0 run tellraw @s "Error: Detected 1.15 or below! ..."
execute if score RandomItemGiver rig_VersionCheck matches 1 run tellraw @s "Error: Detected 1.16! ..."
execute if score RandomItemGiver rig_VersionCheck matches 2 run tellraw @s "Error: Detected 1.17! ..."
execute if score RandomItemGiver rig_VersionCheck matches 3 run tellraw @s "Error: Detected 1.18! ..."
execute if score RandomItemGiver rig_VersionCheck matches 4 run tellraw @s "Error: Detected 1.19! ..."

scoreboard players set RandomItemGiver rig_CheckedCompatibility 1

While I've not tested it yet it should work out pretty fine. With the right adjustments and maybe some additional checks for other things I might also be able to narrow down the version even more (by using certain files that only work in certain versions because of command changes for example), but I'm happy if it works this way. Only downside I found so far is that it only detects issues if you're on a datapack that is too new for you version. Maybe I'll find a check for the other way around as well, we'll see. Not sure when or if I'm gonna implement this, for now it's just a theory.

Move pottery sherds and smithing templates to their own loot table

The chance of getting a smithing template or a pottery sherd is currently way to high, and even worse, they're pretty useless. That's why the chance for them needs to be lowered. Moving them to their own loot table will also allow me to add an option to completely disable them (couldn't imagine why anyone would want that ;) ).

  • Move smithing templates to their own loot table
  • Move pottery sherds to their own loot table
  • Add option to disable smithing templates
  • Add option to disable pottery sherds

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.