#(Fennx1000) Mining Drill

1 messages · Page 1 of 1 (latest)

graceful haven
#

Is there an event to constantly check if the players inventory has an item in it...

proper sandalBOT
#

(Fennx1000) Mining Drill

proper sandalBOT
#

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.

graceful haven
#

oh and also btw how do i make it so it makes the item look like another item

marsh reef
#

!xy

rich talonBOT
# marsh reef !xy
Info: 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).

marsh reef
#

Why don't you explain your end goal?

graceful haven
#

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

marsh reef
#

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

rich talonBOT
marsh reef
#

!e player clicks block

rich talonBOT
# marsh reef !e player clicks block
Group

Player

**WARNING**

this event may in some cases double-fire, requiring usage of the 'ratelimit' command (like 'ratelimit <player> 1t') to prevent doubling actions.

Event Lines

player (right|left) clicks <block>

Switches

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.

Triggers

when a player clicks on a block or in the air.

Has Player

Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<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.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

marsh reef
#

^ this guy for the right click event

#

!c cast

rich talonBOT
# marsh reef !c cast
Group

entity

Syntax

cast [<effect>] (remove) (duration:<value>) (amplifier:<#>) (<entity>|...) (no_ambient) (hide_particles) (no_icon) (no_clear)

Short Description

Casts a potion effect to a list of entities.

Description

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...

marsh reef
#

^ 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

rich talonBOT
# marsh reef !m custom_model_data

Changes the custom model data ID number of the item.
Use with no input to remove the custom model data.

Object

ItemTag

Input

ElementTag(Number)

Tags

<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...

marsh reef
#

if that's not what you want then,

#

!m material

rich talonBOT
# marsh reef !m material
Cannot Specify Searched Mechanism

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, ...

#
Possible Confusion

Did you mean to search for command heal?

marsh reef
#

!m itemtag.material

rich talonBOT
# marsh reef !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.

Object

ItemTag

Input

MaterialTag

Tags

<ItemTag.material> Returns the MaterialTag that is the basis of the item. EG, a stone with lore an...

marsh reef
#

you could just use this

graceful haven
#

why is this returning a error

frozen marten
#

!c cast

rich talonBOT
# frozen marten !c cast
Group

entity

Syntax

cast [<effect>] (remove) (duration:<value>) (amplifier:<#>) (<entity>|...) (no_ambient) (hide_particles) (no_icon) (no_clear)

Short Description

Casts a potion effect to a list of entities.

Description

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...

frozen marten
#

What is the error?

graceful haven
#

fixed

#

however

#

do u know how i can change the overall mining speed

#

there is no attribute

#

for it

marsh reef
#

efficiency enchantment

graceful haven
#

i dont want an enchantment on it

#

i would like the natural stats to change

marsh reef
#

also there is an attribute for it

graceful haven
#

i cant find it

#

what is it

marsh reef
#

Pretty sure, anyway

#

lmc

frozen marten
graceful haven
#

ok and

frozen marten
#

You can maybe equip a helmet that has the attribute to sort of make it seem like the natural stats are higher

graceful haven
#

wdym i just want an efficiency enchant that does not actually work as an enchantment

frozen marten
#

You want to increase the base mining speed, correct?

graceful haven
#

yes

marsh reef
#

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

frozen marten
marsh reef
#

I couldn't find it

#

feel free to look

frozen marten
#

Oh yeah there isn't

frozen marten
graceful haven
#

k

#

I have a short term memory variable. How do I add stuff to the variable at different points

frozen marten
#

!paste

rich talonBOT
graceful haven
frozen marten
#

First of all, all the code needs to be inside a script

graceful haven
#

k done

marsh reef
#

!g short term memor

rich talonBOT
marsh reef
#

^ suggested reading

frozen marten
#

And second, can the amplifier: even take decimal numbers?

marsh reef
#

It'll just truncate it i think

#

shouldn't cause any errors

graceful haven
#

oh thx i did it

snow turtle
rich talonBOT
# snow turtle !ds https://paste.denizenscript.com/View/118588
Script Check Results
Encountered Critical Errors

On line 1: Invalid YAML! Error message: While parsing a block collection, did not find expected '-' indicator.

Minor Warnings

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.

Other Script Information

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

Shortened Lines

There are 13 lines that were merged into other lines.

snow turtle
#

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

rich talonBOT
snow turtle
#

Use this tag to fill an empty line.

graceful haven
#

k

#

but the first line has an error

snow turtle
# rich talon

Listen on what helpers tell you, the solution to the other problem was already given.

graceful haven
#

that is on thefirst item

snow turtle
graceful haven
#

oh

snow turtle
#

The file structure is broken somewhere.

#

(which is very likely caused by line 109)

graceful haven
#

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

snow turtle
#

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

rich talonBOT
graceful haven
#

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

snow turtle
#

!guide common mistakes - adjust is not for items

rich talonBOT
#
Possible Confusion

Did you mean to search for common mistakes - the adjust command is not for items/materials/etc.?

graceful haven
#

- inventory adjust slot:5 custom_model_data:1 So this. But where would I put it

snow turtle
#

You put it where ever you need to custom_model_data change to happen.

graceful haven
#

yea but i always want it like this

#

when you get it

snow turtle
#

It's a mechanism, so put it inside the item script under mechanisms:.

#

No need for the inventory command then.

graceful haven
#

how do i get the slot of my custom item

snow turtle
#

I'm confused.

graceful haven
#

well i want a specific slot

#

(my custom item)

snow turtle
#

Please elaborate how your script should work, how it currently looks like and what should happen.

#

!paste

rich talonBOT
graceful haven
snow turtle
#

!guide mechanism

rich talonBOT
snow turtle
#

Please check the guide page above.

#

I'll continue when you fixed the error in your item script.

graceful haven
#

my error gone mechanisms: - inventory adjust mining_drill custom_model_data:1

snow turtle
#

This is a scripting error, refer to the guide page above.

graceful haven
#

an error was there but now it is gone

snow turtle
#

Did you read the whole page?

graceful haven
#

yea it was in events

#

but as we know

snow turtle
#

Can you post your current script again please?

graceful haven
#

it needs to be always active

snow turtle
graceful haven
#
    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

snow turtle
#

You still have the blatant scripting error in your item script.

graceful haven
#

where

snow turtle
#

The mechanism

#

I told you two times.

#

I won't tell you again.

#

!guide mechanism

rich talonBOT
snow turtle
#

Check the guide page on how mechanism work.

graceful haven
#

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>```
frozen marten
#

What makes you think that if check would work?

#

!t entity.has_effect

rich talonBOT
frozen marten
#

This is what you're looking for to put in that if check ^

graceful haven
#

what would the context be like this if <EntityTag.has_effect<fast_digging>:

marsh reef
#

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

graceful haven
#

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

snow turtle
#

The guide teaches you

graceful haven
#

which one

snow turtle
#

!guide

rich talonBOT
marsh reef
#

the answer to your question is fundamentally that you should already know

snow turtle
#

This one

marsh reef
#

we're happy to help, but you gotta help yourself too

mellow knotBOT
#
Thread Closing Reminder

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