#(nimsy) trying to create a "multitool" pic with a constant breaking speed on all materials
1 messages · Page 1 of 1 (latest)
(nimsy) trying to create a "multitool" pic with a constant breaking speed on all materials
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.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
i figured there's two ways i can do it:
- just adjust all the block_strength of every single material on my map to the same number
- use math and somehow calculate the breaking speed based on the block you're breaking's block_strength and the potion effects (haste and fatigue) you have on you
It's more direct to do the first one.
You can also just fake the mining
It's basically
- Cancel the block click event
- block crack while holding left click
- Make block break after however long
yea
The only tricky part is determining left click. The way I did it was
on player left clicks block
That only fires for the inital click
on player animates:
- flag player skillable.is_holding_left_click expire:3t
on player left clicks block flagged:!skillable.is_holding_left_click priority:-10:
- flag player skillable.is_holding_left_click expire:1t```
!t visual_pose
Returns the name of the entity's current visual pose.
See https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Pose.html
attributes
ElementTag
there's a digging thing in there
So on player left clicks block is the initial click. I give them a 1t flag, then use on animate to refresh the tag. On animate only ever seems to fire when you swing your arm, ie mining.
The pose thing might work too. Something like "while pose == digging"
you'll have to tias though
But defintely either set all materials, or just force all blocks to break at the same speed by overwriting vanilla mining mechanics.
I might do the second one tbh
Because i also want to save the progress on the broken block
Ie you break a block halfway, it stays that way
Yo @desert rain what if I flagged the blocks with how much damage they’ve taken? Would that make the gamemode laggy for a 100 players constantly doing the same thing you think?
also @desert rain is it guaranteed that the player clicks block event always fires before the animates event?
Tbh, I have no idea. From using it, it seemed to.
yea looks like it
Not really, flags don't do anything once you set the value.
ok cool ty
wait hang on @desert rain i just got another idea
i could literally just use custom blocks for any of the blocks i wanna use
ie noteblocks
retextured
rip, setting the block as - blockcrack <[block]> progress:0 players:<server.online_players> doesn't seem to prevent the block from getting the break effect
im thinking of just switching the player between survival and adventure mode in that case
actually nvm that wouldn't work
yo @desert rain how would i cancel/override any current blockcrack effects?
!c blockcrack
player
blockcrack [<location>] [progress:<#>] (stack) (players:<player>|...)
Shows the player(s) a block cracking animation.
You must specify a progress number between 1 and 10, where 1 is the first stage and 10 is the last.
To remove the animation, you must specify any number outside of that range. For example, 0.
Optionally, you can stack multiple effects
fort_pic_handler:
type: world
debug: false
events:
on player animates ARM_SWING with:fort_pic flagged:fort.pic.block_target:
- define block <player.flag[fort.pic.block_target]>
- flag player fort.pic.block_target:<[block]> duration:3t
#- if <[block].flag[health]> == -1:
#- determine passively cancelled
- blockcrack <[block]> progress:0 players:<server.online_players>
- ratelimit <player> 1t
on player clicks block type:!air:
- stop if:<player.world.name.equals[fortnite_map].not>
- determine passively cancelled
- if <player.item_in_hand.script.name||null> == fort_pic:
- define block <context.location>
- flag player fort.pic.block_target:<[block]> duration:1t
#flag the block health if it hasn't been set yet
- if !<[block].has_flag[health]>:
- define mat <[block].material.name>
- define type <proc[get_material_type].context[<[mat]>]>
#if it's not in the list of valid materials to return either wood, brick, or metal
- if <[type]> == null:
- define hp -1
- else:
- define hp <script[nimnite_config].data_key[materials.<[type]>.hp]>
- flag <[block]> health:<[hp]>
this is what i have rn
You should just be able to set it to 0
i set it to 0 but it doesn't wokr
doesn't work as in the actual block cracking still happens
Is the clicks block event firing?
!paste
Help us help you by pasting your script to https://paste.denizenscript.com/New/Script and linking it back here.
Or sorry, debug
oops wrong thing
Content of Denizen Script Paste #108307: Unnamed Denizen Script Paste... pasted 2023/04/02 16:31:29 UTC-07:00, Paste length: 1991 characters across 62 lines, Content: fort_pic: type: item
here's the pic
how would u like me to debug it?
there's not really any errors
Turn debug true on, and try mining a block
Content of Server Log Paste #108308: Denizen Debug Logs From Nimbus Local Server... pasted 2023/04/02 16:32:14 UTC-07:00, Paste length: 49812 characters across 331 lines, Content: Java Version: 17.0.5Up-time: 2h 11m
Ya, idk. The initial (real) block crack effect is prevented by the on click block event. The event is getting cancelled, so idk why you'd still be seeing it. You shouldn't need to set the blockcrack to zero unless you're trying to clear out your own effect. What happens if you just have an event that does ```yaml
on player clicks block:
- determine cancelled``` is the block crack still there?
Basically make an mcve
it lets me break the block
but then cancels the breaking
basically does the same thing as
- determine cancelled
What? I wonder if something changed. It used to not do that. 
what should i do now? 😭
i dunno. can you have your players in adventure mode?
sure yea
cause that'll turn off regular mining
but then id have to calculate what block they're looking at
<player.cursor_on> with the range thing
Doesn't on click still fire?
no
gdmit thats annoying
ikr
still, that might be the solution
right clicking does though
i have an idea
1 sec
bruh
doesn't work
tried doing
on player clicks block:
- change to adventure
on player stops damging block:
- change to survival
i mean it works, but when you change to adventure mid-break, it still lets you break the block for some reason
ok so @desert rain quick update, it seems like if the blockcrack of a block is greater than the state being broken, it stays the same
for example if i change the block's state to 9 and i mine it, it'll stay at 9 until i break it further than 9
i thin i might just uhh
use noteblocks with custom textures
yo
nvm bruh this is so hard when i can't even cancel the original block breaking effect...
Yo so @desert rain or any other helpers, is there no way to disappear/override any block crack effects?
rule 3
cant you set it to 0?
We already tried that
When
uhh i dont remember i think during 1.18.2
nvm 1.19.3...
i think i didnt something else then
i had an issue where blockcrack would stay after the block was gone
IM GONNA CRY
I TRIED TO MAKE PROGRESS ALL DAY AND THEN THIS IS THE ISSUE THAT PERSISTS 😭
bruh
i just tried using the block_strength mech and it has no effect................................................. im so annoyed rn i think img enuienly losing my sanity
Perhaps thinking outside of the box here, you could replace your blocks with mushroom blocks in different orientations, akin to some prison-esque maps, and using a resource pack to give them their own block texture.
it's not closing, it's just getting hidden
how to stop it from hiding
honestly cant you just give them like 500 haste or something
and then make it so that you have to break that block over and over again
hmm interesting
like you're saying
give the block multiple "lives"?
ye
it also saves the hp over time too
so no need for blockcrack to update to 0
you gave me an idea tho
i think i might just use slow digging depending on the type of material and that's it
arent effects really finicky as in like not much custmizability and 2 slow digging is wayy more than 1
¯_(ツ)_/¯
woah you have this planned for april 7th..
thats a bit tight aint it
considering you dont have this yet
ok @rotund sinew
hi nimsy
things are going well except it seems like if i give the player fast digging 999 or smth the block breaking only registers when i click once and not hold left click
well yeah because youre insta breaking it no?
yea
does determine cancel the block break not work?
then go with the noteblocks retextured then
isnt mergu working on it with display entities
you can have custom blocks in that way no?
you dont even need texture packs
how so
you can hold down left click and it'll still continue breaking the block after you place something front
huh
nice
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.)
@thick iris