025 Part 2 Flickering lights. [Minecraft 1.21 Datapack]

  Рет қаралды 109

Infernal Device

Infernal Device

Күн бұрын

Пікірлер: 8
@AntiGameBoy
@AntiGameBoy 3 күн бұрын
This has so much potential for horror maps! Great video
@InfernalDevice
@InfernalDevice 3 күн бұрын
It does make things a lot creepier. :)
@sotoso8680
@sotoso8680 3 күн бұрын
Hi, I have a question regarding the removal of items from a player's inventory. I am creating a map in which I want to create a mechanism where, when it starts raining, it removes 50% of all equipment. So let's say I have 8 apples and 4 sticks, I want it to remove these 4 apples and 2 sticks. Do you know how to do this?
@InfernalDevice
@InfernalDevice 3 күн бұрын
Hello. :) Sounds a bit tricky. You could count the number of apples using clear 0 and save that to a scoreboard, then divide that scoreboard by 2 and give that many number of apples back, but that would move all the items around, and you would need to do it for every item type in the game, which seems crazy. :) A better way would probably be to loop over every inventory slot using a macro, save the item id to storage and the item count to a score. Then divide the score by 2 and using another macro put the item back with the new count. I don't know how Minecraft deals with a score of 1 being divided by 2, is the result 0 or 1, although I suppose you could add a line like if score = 0 then set it to 1 if you wanted?
@sotoso8680
@sotoso8680 3 күн бұрын
@@InfernalDevice Thanks for your answer! I think it is too complicated for me though and I will try to make a different but similar mechanism.
@InfernalDevice
@InfernalDevice 3 күн бұрын
@@sotoso8680 I made a note of it and will have a play around at some point. Seems like an interesting thing to try. :)
@InfernalDevice
@InfernalDevice 13 сағат бұрын
Hello, I was going to play around with this, and I mentioned my ideas to GalSergey. They answered shortly after with the following, so all credit to them. :D It does the hotbar, inventory and offhand. This won't remove the last item in a slot. # function example:half data remove storage example:data inv data modify storage example:data inv set from entity @s Inventory data remove storage example:data inv[{Slot:100b}] data remove storage example:data inv[{Slot:101b}] data remove storage example:data inv[{Slot:102b}] data remove storage example:data inv[{Slot:103b}] function example:loop_check # function example:loop_check function example:slot_convert with storage example:data inv[-1] execute store result storage example:data clear int -0.5 run data get storage example:data inv[-1].count function example:clear_slot with storage example:data inv[-1] data remove storage example:data inv[-1] execute if data storage example:data inv[-1] run function example:loop_check # function example:slot_convert $data modify storage example:data inv[-1].Slot set value "container.$(Slot)" $execute if predicate {condition:"minecraft:value_check",value:$(Slot),range:-106} run data modify storage example:data inv[-1].Slot set value "weapon.offhand" # function example:clear_slot $item modify entity @s $(slot) example:half_clear # item_modifier example:half_clear { "function": "minecraft:set_count", "count": { "type": "minecraft:storage", "storage": "example:data", "path": "clear" }, "add": true }
@sotoso8680
@sotoso8680 13 сағат бұрын
@@InfernalDevice Thank you so much! You have really helped me! :)
I Built The Worlds Tallest Minecraft Base
1:09:55
Carvs
Рет қаралды 1,5 МЛН
026: Fairy jars. [Minecraft 1.21 Datapack]
58:02
Infernal Device
Рет қаралды 85
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 2,7 МЛН
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 22 МЛН
How I Beat The Password Game
39:53
Bog
Рет қаралды 3,1 МЛН
How I Built a Working Hypertube in Minecraft Hardcore
21:07
TheBestCubeHD
Рет қаралды 842 М.
4 Winter Themed Command Weapons in Minecraft Bedrock❄️
8:05
Michael’s Minecraft Knowledge
Рет қаралды 186
What is the Smallest Possible .EXE?
17:04
Inkbox
Рет қаралды 520 М.
«Осень». Самая большая загадка Windows XP
14:36
Девять десятых
Рет қаралды 1,4 МЛН
Every Softlock in Portal
43:08
Marblr
Рет қаралды 932 М.
I built my own 16-Bit CPU in Excel
15:45
Inkbox
Рет қаралды 1,6 МЛН
So I Broke Minecraft's Code...
12:22
Fundy
Рет қаралды 1,3 МЛН
The greatest aquarium simulator of All-Time.
10:12
Coskerr
Рет қаралды 214 М.
027: Extra heart apples. [Minecraft 1.21 Datapack]
17:02
Infernal Device
Рет қаралды 70