#On mouse over a block event, block:hover
1 messages · Page 1 of 1 (latest)
Yes, I don't necessarily need to edit the vanilla effect, but I would like to add a more visible effect to it.
Its abt resource pack
can you show pics of what you saw
we can do it on detect hover tho
cannot find it rn, I prolly did not give it a like
how? 👀
every tick get a block from view
perfom task and save block to a varible dont run variable
on next tick if new block is same as current one then dont perform task
lastblock = null
tick()
block = fromPlayerView()
if (lastblock == block ) return
lastblock = block
//doStuff```
Mhm, I see and how do I give it the highlighted effect, by replacing the block or something?
u can summon entity or particle
particle is easy and better
create a block like particle
bruh thats not same
ye
ye
ok, just this msg is little wrong
hmmhm, do you have client side solution for this then?
ya not possible without EDITUNG
Oh no sry
Okay, I understand that it is not possible without EDITUNG of the vanilla effect, correct? Not sure how to edit the vanilla one tho.
BTW - do you want to run event on block hover?
Yeah.
Eh
.
This method will suit your need (if your a pc player)
I see, but what about the mobile players?
You can't but some events you can use are
ItemUseOn
entityHit
But not so effective
Imagine a board game like chess, I need to highlight the block, where the player is looking at + on right click make the move.
what that does is it finds first block in the view of player
so when mobile hover other block like on the left then its different block
But again not hover
which first block?
that in the view of the player
Besides that I also need to highlight the path the piece can go.
Imagine the player not using split control
xd
I have never used it on my phone. xd
without it you can click everywhere, so much control...
but then i must overlearn agaion
Oh i wasn't talking abt split controls
I was talking abt
!split_controls
In the code, I keep track of the positions, so I know the coordinates, where the piece can go. I have control over this though the API - server side. That's why I would love to highlight the blocks through it.
I mean I can replace the blocks to highlight the path, but that does not look that good.
I need something more interactive with animations.
u can use custom particles and spawn them on the top of the block
mhm, that could work, I kind of imagined it to be solid without spaces in between each particle, but it could work anyway.
So, I use the code above to highlight the confirm move location?
Which lang is this btw, is it TS? No semicolons? ```lastblock = null
tick()
block = fromPlayerView()
if (lastblock == block ) return
lastblock = block
//doStuff```
Its explanation
😂
How am I supposed to implement it then?
Use ur brain
And thats it
If you need help BAO on the service sir
xD
There is method called getBlockFromViewDirection on player class so just call this and if block is same as behore then player is hovering same block as before-> nothing change
and if change the just run ur code
Great, thanks!
And this is entity?