#(Fennx1000) Mining Drill
1 messages · Page 1 of 1 (latest)
(Fennx1000) Mining Drill
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
oh and also btw how do i make it so it makes the item look like another item
'checking' something is what a tag does, not an event
!xy
Your question seems to be an XY Problem - you're asking about your attempted solution rather than your original problem.
Read in detail about the XY Problem here: http://xyproblem.info/
For an example of an XY Problem we've seen in Denizen, the question "how do I make an event for when a flag expires" has no answer, but the same question asked with full background detail will be something more like "I have this script: [LINK HERE], which sets a 3 minute cooldown flag on a player for when they use an ability. I want the player to be notified when the cooldown completes - how do I do this?" which we can then answer quite effectively (in this example, all that was needed was a simple wait command, no events or flag-listening or anything).
Why don't you explain your end goal?
I am trying to make a mining drill that mines quicker and also when right click it gives haste with a cooldown after. Then also it looks like a prismarine shard
however the material is a netherite_pickaxe
That's pretty easy. You'll want a item script container for your pickaxe. You can use efficency to make it mine faster
use
!e player right clicks block
!e player clicks block
Player
this event may in some cases double-fire, requiring usage of the 'ratelimit' command (like 'ratelimit <player> 1t') to prevent doubling actions.
player (right|left) clicks <block>
with:<item> to only process the event if a specified item was held.
using:hand/off_hand/either_hand to only process the event if the specified hand was used to click.
type:<material> to only run if the block clicked matches the material input.
when a player clicks on a block or in the air.
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.item> returns the ItemTag the player is clicking with.
<context.location> returns the LocationTag the player is clicking on.
<context.relative> returns a LocationTag of the air block in front of the clicked block.
<context.click_type> returns an ElementTag of the Spigot API click type <@link url https://hub.spi...
<context.hand> returns an ElementTag of the used hand.
True - this adds switches in:<area> + location_flagged:<flag name>.
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
entity
cast [<effect>] (remove) (duration:<value>) (amplifier:<#>) (<entity>|...) (no_ambient) (hide_particles) (no_icon) (no_clear)
Casts a potion effect to a list of entities.
Casts or removes a potion effect to or from a list of entities.
The effect type must be from https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html.
If you don't specify a duration, it defaults to 60 seconds.
An infinite duration will apply an infinite duration potion effect, refer to !objecttype DurationTag for more details.
The amplifier is how many levels to *add* over the normal level 1.
If you don't specify an amplifier level, it defaults to 1...
^ for haste
If you want it to act like a pickaxe in shard form, you'd need a resource pack
if you want to do that use
!m custom_model_data
Changes the custom model data ID number of the item.
Use with no input to remove the custom model data.
ItemTag
ElementTag(Number)
<ItemTag.has_custom_model_data> Returns whether the item has a custom model data ID number set on ...
<ItemTag.custom_model_data> Returns the custom model data ID number of the item. This tag is inval...
Multiple possible mechanisms: MaterialTag.age, ItemTag.material, MaterialTag.type, MaterialTag.half, MaterialTag.mode, MaterialTag.note, MaterialTag.count, MaterialTag.delay, MaterialTag.faces, MaterialTag.hinge, MaterialTag.level, MaterialTag.power, MaterialTag.shape, MaterialTag.sides, MaterialTag.snowy, EntityTag.material, MaterialTag.bottles, MaterialTag.heights, MaterialTag.attached, MaterialTag.distance, ...
Did you mean to search for command heal?
!m itemtag.material
Changes the item's material to the given material.
Only copies the base material type, not any advanced block-data material properties.
Note that this may cause some properties of the item to be lost.
ItemTag
MaterialTag
<ItemTag.material> Returns the MaterialTag that is the basis of the item. EG, a stone with lore an...
you could just use this
why is this returning a error
!c cast
entity
cast [<effect>] (remove) (duration:<value>) (amplifier:<#>) (<entity>|...) (no_ambient) (hide_particles) (no_icon) (no_clear)
Casts a potion effect to a list of entities.
Casts or removes a potion effect to or from a list of entities.
The effect type must be from https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html.
If you don't specify a duration, it defaults to 60 seconds.
An infinite duration will apply an infinite duration potion effect, refer to !objecttype DurationTag for more details.
The amplifier is how many levels to *add* over the normal level 1.
If you don't specify an amplifier level, it defaults to 1...
What is the error?
fixed
however
do u know how i can change the overall mining speed
there is no attribute
for it
efficiency enchantment
also there is an attribute for it
Attribute also only works on items
ok and
You can maybe equip a helmet that has the attribute to sort of make it seem like the natural stats are higher
wdym i just want an efficiency enchant that does not actually work as an enchantment
You want to increase the base mining speed, correct?
yes
I was thinking of this guy, which apparently isn't what I thought
So, seems like you're stuck with either the enchantment or some haste shenanigans whenever they're holding it
I would suggest the former
There is an attribute for mining speed I think
Oh yeah there isn't
Weird but yeah, that means Inquisitor is right ^
k
I have a short term memory variable. How do I add stuff to the variable at different points
!paste
Help us help you by pasting your script to https://paste.denizenscript.com/New/Script and linking it back here.
Content of Denizen Script Paste #118582: here... pasted 2023/12/15 11:10:52 UTC-08:00, Paste length: 221 characters across 6 lines, Content: - define drillSpeed = 0Mining_Drill_Script:
First of all, all the code needs to be inside a script
k done
!g short term memor
View the guide page 'Short Term Memory: Definitions' at: https://guide.denizenscript.com/guides/basics/definitions.html
^ suggested reading
And second, can the amplifier: even take decimal numbers?
oh thx i did it
my script does not work idk why. I got an error on my first item https://paste.denizenscript.com/View/118588
Content of Denizen Script Paste #118588: script... pasted 2023/12/15 11:29:44 UTC-08:00, Paste length: 3227 characters across 111 lines, Content: Screaming_Blade: type: item
Content of Denizen Script Paste #118588: script... pasted 2023/12/15 11:29:44 UTC-08:00, Paste length: 3227 characters across 111 lines, Content: Screaming_Blade: type: item
On line 1: Invalid YAML! Error message: While parsing a block collection, did not find expected '-' indicator.
On line 85: Stray space after end of line (possible copy/paste mixup. Enable View->Render Whitespace in VS Code).
On line 5, 23, 24, 25, 26, 27, 41, 59, 60, 61, 84, ...: Data lines should not be quoted. You can use '<empty>' to make an empty line, or '<&dq>' to make a raw double-quote symbol, or '<&sq>' to make a raw single-quote.
On line : (Statistics) Total structural lines: 37
On line : (Statistics) Total live code lines: 36
On line : (Statistics) Total comment lines: 0
On line : (Statistics) Total blank lines: 9
There are 13 lines that were merged into other lines.
Fix the first error.
Line 109 doesn't belong at this place.
Fix the warnings too, you don't need quotes at these places.
!t empty
Use this tag to fill an empty line.
Listen on what helpers tell you, the solution to the other problem was already given.
It's a YAML error. It will always be at line 1.
oh
if i put line 109 on the inside of the event then everytime a block is broken it will be set back to 0 which is bad
Figure out where do you have to put it or if you even need this line.
Do you need to reset this value? If so, when?
Keep in mind that the definition is deleted as soon the script ends. I do think you need flags instead.
!guide long term memory
View the guide page 'Long Term Memory: Flags' at: https://guide.denizenscript.com/guides/basics/flags.html
thankyou I got it to work
but do u know how i can make this work because i want it so it is automatically put on but idk where- adjust <player.item_in_hand> custom_model_data:4
!guide common mistakes - adjust is not for items
Did you mean to search for common mistakes - the adjust command is not for items/materials/etc.?
View the guide page 'Common Mistakes - The Adjust Command Is Not For Items/Materials/Etc.' at: https://guide.denizenscript.com/guides/troubleshooting/common-mistakes.html#the-adjust-command-is-not-for-items-materials-etc
- inventory adjust slot:5 custom_model_data:1 So this. But where would I put it
You put it where ever you need to custom_model_data change to happen.
It's a mechanism, so put it inside the item script under mechanisms:.
No need for the inventory command then.
how do i get the slot of my custom item
I'm confused.
Please elaborate how your script should work, how it currently looks like and what should happen.
!paste
Help us help you by pasting your script to https://paste.denizenscript.com/New/Script and linking it back here.
Content of Denizen Script Paste #118595: script... pasted 2023/12/15 12:04:38 UTC-08:00, Paste length: 736 characters across 24 lines, Content: Mining_Drill : type: item
!guide mechanism
View the guide page 'Mechanisms And Properties' at: https://guide.denizenscript.com/guides/basics/mechanisms.html
^
Please check the guide page above.
I'll continue when you fixed the error in your item script.
my error gone mechanisms: - inventory adjust mining_drill custom_model_data:1
This is a scripting error, refer to the guide page above.
an error was there but now it is gone
Did you read the whole page?
Can you post your current script again please?
it needs to be always active
wat
type: item
debug: false
material: netherite_pickaxe
display name: "<yellow>Mining Drill"
mechanisms:
- inventory adjust mining_drill custom_model_data:1
recipes:
1:
type: shaped
input:
- air|redstone_block|air
- potato|netherite_sword|potato
- air|redstone_block|air
lore:
- "<blue>Combat"
- ""
- "<dark_blue><bold>MINING MULTIPLIES DIG SPEED!!!"
Mining_Drill_Script:
type: world
events:
after player breaks block with:mining_drill:
- flag player drillSpeed:++
- cast fast_digging duration:10s amplifier:<player.flag[drillSpeed]> <player>```
the texture
You still have the blatant scripting error in your item script.
where
View the guide page 'Mechanisms And Properties' at: https://guide.denizenscript.com/guides/basics/mechanisms.html
Check the guide page on how mechanism work.
Ok I managed to make my custom meta data texture work and now it is in the game
However
I have a bit of a problem
you see when you loose haste I want the variable to be set to 0 but my code does not work
type: world
events:
after player breaks block with:mining_drill:
if(!player has fast_digging):
- flag player drillSpeed:0
- flag player drillSpeed:++
- cast fast_digging duration:10s amplifier:<player.flag[drillSpeed]> <player>```
Returns whether the entity has a specified effect.
If no effect is specified, returns whether the entity has any effect.
The effect type must be from https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html.
attributes
ElementTag(Boolean)
EntityTag.potion_effects
This is what you're looking for to put in that if check ^
what would the context be like this if <EntityTag.has_effect<fast_digging>:
It seems like you're just throwing things at the wall
You should follow through the guide, it teaches you how to put these pieces together
you've presented quite a few code snippets that share no resemblance with correct syntax
It seems like you have some prior programming experience, but it won't help if you don't know how to actually write a script
This is not really answering my question. I understand that I need to use this has effect tag however what is the context i do this
The guide teaches you
which one
!guide
View the Denizen Beginner's Guide at https://guide.denizenscript.com/
the answer to your question is fundamentally that you should already know
This one
we're happy to help, but you gotta help yourself too
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@graceful haven