#Redstone ore detection
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
You can use an advancement withe an item_used_on_block trigger or a step_on condition
Would that function even with powered redstone ore? If so, that is not what I want
Powerd and unpowere redstone ore are two different block states. You can make the check more specific and make it only trigger if it has one specific block state
Advancements are a player only thing.
They also execute a reward function from and as the player
Would it look something like this?
{
"criteria": {
"interact_with_redstone_ore": {
"trigger": "minecraft:player_interacted_with_block",
"conditions": {
"block": "minecraft:redstone_ore"
}
}
},
"rewards": {
"function": "namespace:your_function_name"
}
}
Would that detect the interaction with redstone ore?
How would i go about the check for specific block states?
I suggest using misode to make the advancement, it is much easier
Awesome website with generators for almost everything. Also contains a technical changelog for new versions, guides on how to use some features, a performance report inspector and more!
Full list of generators: Loot Tables, Predicates, Item Modifiers, Advancements, Recipes, Text Components, Damage Types, Chat Types, Trim Materials, Trim Patterns, pack.mcmetas, Dimensions, Dimension Types, Biomes, Configured Carvers, Configured Features, Placed Features, Density Functions, Noise, Noise Settings, Structures, Structure Sets, Processor Lists, Template Pools, World Presets, Flat World Presets, World Settings, Block Tags, Entity Type Tags, Fluid Tags, Game Event Tags, Item Tags, Biome Tags, Structure Tags, Blockstates, Models, Fonts, Atlases
There is a field called Blockstate, look ingame with f3 what that Blockstate is called exactly and then put that in there, press the plus button and then select boolean.
what would the criteria be?
Item used on block
Would that mean an item would be necessary to activate the advancement?
I'm confused with the requirements tab
Where would I find this?
In misode
One minute, I'm on my pc in just a moment, then I can show you better
okay 🙂
that changes a little bit
I still found where I need to be
only write lit in the field an then press the green plus
The only difference is location is not a condition anymore
it will look like this
yes
click on string and select boolean
then, make it true or false, depending on what you want
So true would mean the redstone ore that is lit would activate the datapack reward to the player?
yes, true means only lit ores can activate it
I want players who activate the redstone ore to recieve a reward
then set it to false
ah ok
and for the reward, would a /give loot pouch
function work?
a loot table also could work
if the player is supposed to get an item and nothing else should happen, then a loot table is enough
sure
so the modded loot table is
{LootTable:"mineminenomi:chests/marine_large_base/captain"}
would I simply paste that into loot tables?
no, only the path
Yea I figured that out
I see
And a display wouldn't be necessary
I would now download this and paste this into the datapacks folder?
Oh this is a json
that or just copy the code
I was testing around but it seems you can't detect if the player r-clicks an unlit redstone ore
the advancements is apparently later in the tick list than the block state change
is there any workaround?
raycast
raycast?
yeah, it has something to do in which order the events are processed internally
i'm probably asking the wrong question, but did you forget to set the block id?
maybe double check if everything is there
I did forget it
ah thank god
but it doesn't seem to change anything
it detects the click, the only thing that doesn't work is checking for a click on an unlit ore
the block state changes from unlit to lit before the advancement checks it, that's why you can't check for unlit
could be a possibility
I've got no modded coding experience 😂
thats gonna be fun
what works though is the step on ccheck
This is a 2 step process, making a predicate and an advanccement
1,000,000€ by tomorrow would be nice
i can't afford that even selling my organs -_-
please share
The predicate is a simple location check with a y offset of -1, the block and block state is the same as before
predicates need to be in a separate predicates folder in your datapack
the reward comes in the advancement part
we only need the predicate because with and advancement location check, we can't have an offset
since you have it working, wouldn't it be easier to send me the datapack you got working?
I'm a little new on the whole datapack fomatting
I don't have a full data pack, I was just testing the other stuff earlier.
so the advancement we just made is still here, with or without a position check?
the predicate is the location check?
the predicate is the location check and we need to change the advancement to a tick advancement that references the predicacte.
everything in betweenn <> is just a placeholder
.
├── pack.mcmeta
├── pack.png
└── data
└── <namespace>
├── advancements
├── functions
├── item_modifiers
├── loot_tables
├── predicates
├── recipes
├── structures
├── chat_type
├── damage_type
├── tags
│ ├── blocks
│ ├── entity_types
│ ├── fluids
│ ├── functions
│ ├── game_events
│ ├── items
│ ├── chat_type
│ └── damage_type
├── dimension
├── dimension_type
└── worldgen
├── biome
├── configured_carver
├── configured_feature
├── density_function
├── noise
├── noise_settings
├── placed_feature
├── processor_list
├── structure
├── structure_set
├── template_pool
├── world_preset
└── flat_level_generator_preset
```
removed <>, now it works
i think I got the datapack formatted, i'll try running it
my game crashes?
i'll try another instance without mods
The logs are where Minecraft displays errors when something goes wrong and can thus help you gain information about why something isn't working for you!
To open the logs:
- Enable logs in the Minecraft Launcher
- Start your game (or restart it if you already have an open instance)
- Enjoy spotting errors getting much easier!
i'm using ATlauncher, but I think I found it
i'll try a new instance before I send the crash log
yea its the datapack
for the predicate, do I need to set an X and Z offset as ~?
no
I can send a full crash log if that helps
yeah
I'll try it in vanilla launcher
could you send your pack, just to confirm it's right?
I found 3 issues with the structure of your datapack.
- I couldn't find
pack.mcmeta. Make sure that it exists in the root of the zip. - I couldn't find the folder
data. Make sure that it exists in the root of the zip. - I couldn't find the namespace
minecraft. It isn't required, but 90% of datpacks do need to have it. If you don't use tick/load functions or you don't need to change vanilla data, then disregard this.
apart from that it looks ok
I found 1 issues with the structure of your datapack.
- I couldn't find
pack.mcmeta. Make sure that it exists in the root of the zip.
no
i'll try 5
it just for a message ingame telling you that it's from an older version
Format: 4 Version(s): 17w48a–19w46b
Format: 5 Version(s): 1.15-pre1–1.16.2-pre3
Format: 6 Version(s): 1.16.2-rc1–1.16.5
Format: 7 Version(s): 20w46a–1.17.1
Format: 8 Version(s): 21w37a–22w07a
Format: 9 Version(s): 1.18.2-pre1–1.18.2
Format: 10 Version(s): 22w11a–1.19.3
Format: 11 Version(s): 23w03a–23w05a
Format: 12 Version(s): 23w06a–1.19.4
Format: 13 Version(s): 23w12a–23w14a
Format: 14 Version(s): 23w16a–23w17a
Format: 15 Version(s): 23w18a–1.20.1
Format: 16 Version(s): 23w31a
Format: 17 Version(s): 23w32a–23w35a
Format: 18 Version(s): 1.20.2-pre1–1.20.2
Format: 19 Version(s): 23w40a
Format: 20 Version(s): 23w41a
Format: 21 Version(s): 23w42a
Format: 22 Version(s): 23w43a–23w43b
Format: 23 Version(s): 23w44a
Format: 24 Version(s): 23w45a
Format: 25 Version(s): 23w46a
Format: 26 Version(s): 1.20.3-pre1–1.20.4
Format: 27 Version(s): 23w51a–23w51b
Format: 28 Version(s): 24w03a
Format: 29 Version(s): 24w04a
Format: 30 Version(s): 24w05a–24w05b
Format: 31 Version(s): 24w06a
ah ok
btw both
I found no issues with the structure of your datapack.
i'll try sending you a crash log with vanilla minecraft launcher
There's the crash report, and the launcher log
I'll try changing it to "predicates.json" instead of "predicate.json"
@signal chasm
?
What's the question
What were you doing in the datapack?
We were trying to run a step on predicate alongisde an advancement.json that would detect a player walking ontop of a redstone ore
the block state of the redstone ore would go from unlit to lit, thereby activating the reward
To put it simply, I'm trying to reward players for walking ontop of redstone ore (to light it up)
For some reason the datapack simply crashes upon load
Should I wait for HeDeAn if he may be of better help?
you have an incorrect datapack, you only have the namespace "maincraft", there is no namespace "namespace" and "mineminenomi"
how would i go about fixing this?
you can immediately put the predicate in the advancement.
and also, what kind of loot should be on the "mineminenomi:chests/marine_large_base/captain" path?
I tried your changes, but the datapack no longer works as intended
it doesn't crash anymore, but it simply doesn't work
give the datapack again
shall i try changing the loot table reward to a vanilla one?
still does not work with "minecraft:chests/simple_dungeon"
1.16.5
I think I have a solution, but I'll have to test it. I simply set a repeating always active command block that detects players standing upon a redstone ore[unlit]
did it work?
I slept. Timezone different here. I'll get back to you guys soon
execute as @a at @s if block ~ ~-1 ~ minecraft:redstone_ore[lit=false] run loot give @s loot mineminenomi:chests/marine_large_base/captain
Block detection isn't precise though, and players who fall or jump onto the redstone ore trigger the command block multiple times
So the problem isn't really solved...
not really, no
I think I'll try and write a mod from the ground up for this task
what is wrong
The datapack that we have written simply does not work
The command block workaround works, but triggers the reward too many times if players were to fall or hover over the redstone ore
:о
what's the point of the datapack
what does it do
It's meant to detect and give a loot table whenever a player would step on a redstone ore (that is unlit)
whaaaat
but that sounds soooooo easy
is there a blockstate for redstone ore being lit or not?
Yes, we have already tried that
what went wrong
And tried what, exactly? No matter what you try it's always going to at minimum be checking that blockstate
If your question is resolved, that's great to hear! Make sure to run /resolve or click the Resolve Question button. Otherwise, feel free to continue asking for help! :D