So now, we have to tell the shulker to what block we look at ! For that, we summon an armorstand invisible with no gravity, and invulnerable of course !
Then we have to make it look the same ways as us, with a data modify command, and run a function executed by this armor_stand. And when this function if finished, kill the armor_stand.
That completed our first function that I named : "BlockChoose" :
summon armor_stand ~ ~ ~ {NoGravity:1b,Invisible:1b,Invulnerable:1b,Tags:["toi"]}
data modify entity @e[limit=1,tag=toi] Rotation set from entity @s Rotation
execute as @e[limit=1,tag=toi] at @s run function datapack:move
kill @e[limit=1,sort=nearest,tag=toi]
What is in the move function you ask? Go look in it !
tp @s ^ ^ ^.5
execute at @s unless block ~ ~ ~ air run tp @e[limit=1,tag=shushu] @s
execute at @s if block ~ ~ ~ air if entity @p[distance=..20] run function datapack:move
In this function, we move the armorstand in the direction he look (If you remember well, we gave it our Rotation value), and we check if we have a block on it or not. If not, we call the function again, to make it move forward again, and if not, we have our block, so we just have to tp our shulker on the armor_stand. I put a distance so if we look in the sky, our function don't run 65 000 times.
Tadaaa, that's all. You have questions? Not. Good. Bye.
Hey! Sorry to give personal improvement again , but...
Raycasting could be improved, by using zero entities (Shulker is not part of raycasting)...
Testing command (looping each tick, raycasting players must have the tag "Raycasting") :
execute if entity @a[tag=Raycasting] run function datapack:queue
datapack:queue function (making raycasters run one at a time, but all on same tick)
execute as @a[tag=Raycasting,limit=1] run function datapack:trigger_raycasting
execute if entity @a[tag=Raycasting] run function datapack:queue
datapack:trigger_raycasting function (summons shulker and call trigger raycasting)
summon shulker{Bunch of tags,Tags:["Selected"]}
execute as @a[tag=Raycasting] at @s anchored eyes positioned ^ ^ ^ run function datapack:move
tag @s remove Raycasting
tag @e[tag=Selected] remove Selected
datapack:move function (moving shulker to the next valid block)
tp @e[tag=shushu,tag=Selected,limit=1] ~ ~ ~
execute if block ~ ~ ~ air if entity @a[distance=..20] positioned ^ ^ ^.5 run function datapack:move
-I gave the shulker "Selected" tag so there is only one in the world who can be targetted each time-
When it comes to "move" function :
-It is ran as/at the player, anchored eyes
-If it finds air, it will run the function again ^ ^ ^.5 further...
-...but the "^ ^ ^.5" is taken from the player's rotation
-Now, if it found air, "move" function is ran again, but already ^ ^ ^.5 from the player
-And if it finds air once more, it will keep moving ^ ^ ^.5 further, meaning the second time, it will now run at ^ ^ ^1 from the player, then ^ ^ ^1.5, then ^ ^ ^2
-...etc. Raycasting does not need entities, if you make it change its position from itself.
This could be a good improvement to the raycasting (sorry to react to almost every single post you make!!!:o)
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
...Literally posting tutorials to get improvements...
Strange, but... yeah! Here's a good way to learn things we don't even thought of!
Rollback Post to RevisionRollBack
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
I want it to do it every tick, not only one at a time, and when I try with your code, the shulker try to move on another block, but is tp back to is initial block.
To be honest, I wrote that by heart... I am currently rooting my phone lol
Rollback Post to RevisionRollBack
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
tag @a[tag=Raycasting] add Request
execute as @e[type=shulker,tag=Raycasted] run tp @s ~ ~-1000 ~
kill @e[tag=Raycasted]
tag @e[tag=Raycasted] remove Raycasted
execute if entity @a[tag=Request] run function datapack:queue
In queue function :
execute as @a[tag=Request,limit=1] at @s run function datapack:trigger
execute if entity @a[tag=Request] run function datapack:queue
In trigger function :
execute as @a[tag=Raycasting] at @s anchored eyes positioned ^ ^ ^ run function datapack:move
tag @s remove Request
tag @e[tag=Selected] remove Selected
In move function :
execute unless block ~ ~ ~ air align x align y align z positioned ~.5 ~ ~.5 run summon shulker ~ ~ ~ {Invulnerable:1,Rotation:[0.0f,0.0f],Glowing:1,NoAI:1,Tags:["Raycasted"]}
execute if block ~ ~ ~ air if entity @a[distance=..20] positioned ^ ^ ^1 run function datapack:move
give yourself the tag "Raycasting", then you will be raycasting (didn't add invisibility effect to shulker)
This is also compatible in multiplayer...
BUT...
For some deep minecraft reason, the shulkers have their rotation a bit glitchy when they spawn... I believe that is because they try to get on the same block than another shulker, though I kill this other shulker earlier in the tick.
I guess shulkers are still quite laggy : I summon them a bit upper then try to teleport them to the raycasted block, but they only show where they were summoned, not on the block. However, if I kill them, they appear to die on the block position.
I don't do this often, but... gonna give up on this for now. Anyone can feel free to improve that thing
Right now, I got into the process of repairing my samsung galaxy note 4 phone... it is broken at some point I have to place it in the fridge for 5 minutes (battery apart) to make it boot. The operating system works smoothly, but gets frozen frequently, and displays "installing system update" for minutes each time I have to boot into recovery mode.
I even rooted and installed a custom recovery, but there seems to be plenty of files missing, stuff like that in the phone... still struggling to flash a custom rom.
Flashing files, putting back into fridge each time I wanted to reboot in download mode to try another file : that was my last night.
I installed samsung kies... well, this is the first time I see a driver that actually prevents detecting the phone it is used to detect. Odin flasher finds my phone instantly, and the official samsung app itself can not even load it, though it keeps loading, loading...
I think if samsung wanted me to buy a new phone, they would be better to just point a gun at my face, it would be more subtle...
I already spent some time on that yesterday, and will probably do the same tonight.
And so, well... I am maybe not that motivated to experiment things with shulkers for why they are lagging briefly during the process...
Rollback Post to RevisionRollBack
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
datapack:queue function (making raycasters run one at a time, but all on same tick)
When you call "/execute as @a" it branches off and runs separately for each entity, one after another. So there is no need to worry since the function will finish for the first entity before starting with the second. Minecraft effectively has its own queuing system!
(And this could in fact cause errors since you use "/execute as @a[tag=Raycasting]" in your trigger function. This would cause everyone tagged "Raycasting" to run this function as many times as there are raycasters)
ticked function:
execute as @e[type=shulker,tag=Raycasted] run tp @s ~ ~-1000 ~
kill @e[tag=Raycasted]
execute as @a[tag=Raycasting] at @s anchored eyes positioned ^ ^ ^ run function datapack:trigger
trigger function:
execute unless block ~ ~ ~ air align xyz run summon shulker ~.5 ~-.01 ~.5 {Invulnerable:1,Glowing:1,NoAI:1,Silent:1,Tags:["Raycasted"],ActiveEffects:[{Id:14,Amplifier:0,Duration:10,ShowParticles:0b}],Rotation:[180.0f,0.0f]}
execute if block ~ ~ ~ air if entity @s[distance=..20] positioned ^ ^ ^.5 run function datapack:trigger
By using /data get I saw that the spawned shulkers had a rotation of 180.0 which fixed the problem with them rotationg as they were spawned. I also lowered them by .01 blocks because there was a weird texture glitch with the tops of the blocks. The only problems are that the invisibility effect doesn't seem to activate for the first tick when they spawn, so you can always see them. And secondly, if you look at a transparent block (like tall grass, buttons, levers, etc.) the shulker spawns there and obstructs your view. It also makes it very difficult to turn off levers that power the command blocks you're using to test! But I imagine you could fix that problem with a custom block tag, I just didn't take the time to do so
Hello, my dear friends !
Today, we gonna how to make a block selector.
By block selector I mean, the block you look at will glow !
How we do that ? Simple ! With a friend : Shulker !
So first we have to summon this shulker, but we have to make it non-letal for us, and with a beautiful glowing effect and invisible ! Like this :
Yay ! We have a shulker to help us !
So now, we have to tell the shulker to what block we look at ! For that, we summon an armorstand invisible with no gravity, and invulnerable of course !
Then we have to make it look the same ways as us, with a data modify command, and run a function executed by this armor_stand. And when this function if finished, kill the armor_stand.
That completed our first function that I named : "BlockChoose" :
What is in the move function you ask? Go look in it !
In this function, we move the armorstand in the direction he look (If you remember well, we gave it our Rotation value), and we check if we have a block on it or not. If not, we call the function again, to make it move forward again, and if not, we have our block, so we just have to tp our shulker on the armor_stand. I put a distance so if we look in the sky, our function don't run 65 000 times.
Tadaaa, that's all. You have questions? Not. Good. Bye.
I like trains... OF CHAIN COMMAND BLOCKS !
Hey! Sorry to give personal improvement again , but...
Raycasting could be improved, by using zero entities (Shulker is not part of raycasting)...
Testing command (looping each tick, raycasting players must have the tag "Raycasting") :
datapack:queue function (making raycasters run one at a time, but all on same tick)
datapack:trigger_raycasting function (summons shulker and call trigger raycasting)
datapack:move function (moving shulker to the next valid block)
-I gave the shulker "Selected" tag so there is only one in the world who can be targetted each time-
When it comes to "move" function :
-It is ran as/at the player, anchored eyes
-If it finds air, it will run the function again ^ ^ ^.5 further...
-...but the "^ ^ ^.5" is taken from the player's rotation
-Now, if it found air, "move" function is ran again, but already ^ ^ ^.5 from the player
-And if it finds air once more, it will keep moving ^ ^ ^.5 further, meaning the second time, it will now run at ^ ^ ^1 from the player, then ^ ^ ^1.5, then ^ ^ ^2
-...etc. Raycasting does not need entities, if you make it change its position from itself.
This could be a good improvement to the raycasting (sorry to react to almost every single post you make!!!:o)
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
I just post my thing for you to give me improvements.
I'm once again not disappointed!
I don't know why I haven't thought about use the shulker instead of an armor_stand ^^
See you later for next improvement! <3
I like trains... OF CHAIN COMMAND BLOCKS !
...Literally posting tutorials to get improvements...
Strange, but... yeah! Here's a good way to learn things we don't even thought of!
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
Hum... I have a little problem with your code.
I want it to do it every tick, not only one at a time, and when I try with your code, the shulker try to move on another block, but is tp back to is initial block.
I'm so sad I'm gonna cry now.
I like trains... OF CHAIN COMMAND BLOCKS !
oh, gonna try...
To be honest, I wrote that by heart... I am currently rooting my phone lol
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
Well I modified a bit the system :
In ticked function :
In queue function :
In trigger function :
In move function :
give yourself the tag "Raycasting", then you will be raycasting (didn't add invisibility effect to shulker)
This is also compatible in multiplayer...
BUT...
For some deep minecraft reason, the shulkers have their rotation a bit glitchy when they spawn... I believe that is because they try to get on the same block than another shulker, though I kill this other shulker earlier in the tick.
I guess shulkers are still quite laggy : I summon them a bit upper then try to teleport them to the raycasted block, but they only show where they were summoned, not on the block. However, if I kill them, they appear to die on the block position.
I don't do this often, but... gonna give up on this for now. Anyone can feel free to improve that thing
Right now, I got into the process of repairing my samsung galaxy note 4 phone... it is broken at some point I have to place it in the fridge for 5 minutes (battery apart) to make it boot. The operating system works smoothly, but gets frozen frequently, and displays "installing system update" for minutes each time I have to boot into recovery mode.
I even rooted and installed a custom recovery, but there seems to be plenty of files missing, stuff like that in the phone... still struggling to flash a custom rom.
Flashing files, putting back into fridge each time I wanted to reboot in download mode to try another file : that was my last night.
I installed samsung kies... well, this is the first time I see a driver that actually prevents detecting the phone it is used to detect. Odin flasher finds my phone instantly, and the official samsung app itself can not even load it, though it keeps loading, loading...
I think if samsung wanted me to buy a new phone, they would be better to just point a gun at my face, it would be more subtle...
I already spent some time on that yesterday, and will probably do the same tonight.
And so, well... I am maybe not that motivated to experiment things with shulkers for why they are lagging briefly during the process...
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
Ça me ferait plaisir d'aider ! (Non, je ne suis pas français, mais je me débrouille )
When you call "/execute as @a" it branches off and runs separately for each entity, one after another. So there is no need to worry since the function will finish for the first entity before starting with the second. Minecraft effectively has its own queuing system!
(And this could in fact cause errors since you use "/execute as @a[tag=Raycasting]" in your trigger function. This would cause everyone tagged "Raycasting" to run this function as many times as there are raycasters)
ticked function:
trigger function:
By using /data get I saw that the spawned shulkers had a rotation of 180.0 which fixed the problem with them rotationg as they were spawned. I also lowered them by .01 blocks because there was a weird texture glitch with the tops of the blocks. The only problems are that the invisibility effect doesn't seem to activate for the first tick when they spawn, so you can always see them. And secondly, if you look at a transparent block (like tall grass, buttons, levers, etc.) the shulker spawns there and obstructs your view. It also makes it very difficult to turn off levers that power the command blocks you're using to test! But I imagine you could fix that problem with a custom block tag, I just didn't take the time to do so
You seem to speak French well :0
I too have found the way to the shulker rotation and am stuck with the invisibility system.
I don't search for long since I had things to do.
I think I will stop there, take my first system and start another part of my project ^^
I like trains... OF CHAIN COMMAND BLOCKS !