#(firelighth) Golden Pickaxe Tweaking
24 messages · Page 1 of 1 (latest)
(firelighth) Golden Pickaxe Tweaking
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.
!e player breaks block
Player
player breaks block player breaks <material>
with:<item> to only process the event when the player is breaking the block with a specified item.
when a player breaks a block.
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.location> returns the LocationTag the block was broken at.
<context.material> returns the MaterialTag of the block that was broken.
<context.xp> returns how much XP will be dropped.
<context.should_drop_items> returns whether the event will drop items.
"NOTHING" to make the block drop no items.
ListTag(ItemTag) to make the block drop a specified list of items.
ElementTag(Number) to set the amount of xp to drop.
True - this adds switches in:<area> + location_flagged:<flag name>.
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
with:<item> to only process the event when the player is breaking the block with a specified item.
in your case with:golden_pickaxe
then this is where things get a bit tricky
mainly because of the fortune enchantment
if you dont want fortune to work, you can simply - determine (item...) the relevant item and it'll drop normally
if you want it to work, you'll have to - determine cancelled the event, and then use the modifyblock command with the naturally: arg, and provide it a netherite pickaxe with the fortune enchantment
!c modifyblock
world
modifyblock [<location>|.../<ellipsoid>/<cuboid>] [<material>|...] (no_physics/naturally:<tool>) (delayed) (<script>) (<percent chance>|...) (source:<player>) (max_delay_ms:<#>)
Modifies blocks.
Changes blocks in the world based on the criteria given.
Use 'no_physics' to place the blocks without physics taking over the modified blocks.
This is useful for block types such as portals or water. This does NOT control physics for an extended period of time.
Specify (<percent chance>|...) to give a chance of each material being placed (in any material at all).
Use 'naturally:' when setting a block to air to break it naturally, meaning that it will drop items. Specify the tool item that sho...
i think this could be considered object hacking and/or coding malpractice, but you can do <[my_golden_pickaxe].with[material=netherite_pickaxe]> and it'll return an exact copy of everything the golden pickaxe is, but now as a netherite pickaxe (same enchantments, durability, etc etc). good for the naturally arg so you don't have to do too much logic with tags
!t location.drops
Returns what items the block at the location would drop if broken naturally.
Optionally specifier a breaker item.
Not guaranteed to contain exactly correct or contain all possible drops (for things like plants that drop only when grown, ores that drop random amounts, etc).
world
ListTag(ItemTag)
oo yea thats a bit cleaner
ok so instead of cancelling event + using modifyblock with the naturally arg, you'll - determine (...) where the input is whatever this tag outputs when you give it the relevant tool
Feel free to ask if you need any more help, otherwise -
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.)
@steady crescent
I’m currently at work, I’ll close/follow up once I’m able to test it
I may re-open this but at the moment ill close it