Skip to content

Commit 9e57a48

Browse files
committed
fixed item json
1 parent a419dff commit 9e57a48

File tree

3 files changed

+6
-35
lines changed

3 files changed

+6
-35
lines changed

pack/items/debug_stick.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"format_version": "1.20.20",
2+
"format_version": "1.21.90",
33

44
"minecraft:item": {
55

@@ -11,7 +11,7 @@
1111
},
1212

1313
"components": {
14-
"minecraft:custom_component": [ "vyt:debug_stick" ],
14+
"vyt:debug_stick": {},
1515
"minecraft:icon": { "texture": "stick" },
1616
"minecraft:hand_equipped": true,
1717
"minecraft:display_name": { "value": "§dDebug Stick§r" },

pack/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"name": "Debug Stick",
66
"description": "Java §dDebug Stick§r ported to Minecraft: Bedrock Edition, by §bvytdev§r\nUse §a/give @s vyt:debug_stick§r or find it in the inventory screen to obtain the item.\n\nReport bugs here: §bhttps://github.com/vytdev/debug-stick/§r\nCopyright (c) 2023-2025 Vincent Yanzee J. Tan\nLicensed under the MIT License.",
77
"uuid": "21aadfa6-e27c-400c-c596-596021852939",
8-
"version": "1.16.0",
9-
"min_engine_version": [ 1, 21, 80 ]
8+
"version": "1.17.0-beta",
9+
"min_engine_version": [ 1, 21, 94 ]
1010
},
1111

1212
"modules": [
@@ -29,7 +29,7 @@
2929
"dependencies": [
3030
{
3131
"module_name": "@minecraft/server",
32-
"version": "1.19.0"
32+
"version": "2.0.0"
3333
}
3434
],
3535

src/index.ts

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
+* MCPEDL: https://mcpedl.com/debug-stick
77
+* GitHub: https://github.com/vytdev/debug-stick
88
+*
9-
+* Script last updated: April 5, 2025
9+
+* Script last updated: July 22, 2025
1010
+*
1111
+* Copyright (c) 2023-2025 VYT <https://vytdev.github.io>
1212
+* This project is licensed under the MIT License.
@@ -18,7 +18,6 @@ import {
1818
Player,
1919
Block,
2020
BlockStates,
21-
ItemStack,
2221
LiquidType,
2322
world,
2423
system,
@@ -56,16 +55,12 @@ class DebugStickEvents implements ItemCustomComponent {
5655
const player = getPlayerByID(ev.source.id);
5756
if (!player)
5857
return;
59-
if (!isHoldingDebugStick(player))
60-
return;
6158
changeSelectedProperty(player, ev.block);
6259
}
6360

6461
onUseOn(ev: ItemComponentUseOnEvent) {
6562
if (ev.source.typeId != "minecraft:player")
6663
return;
67-
if (ev.itemStack?.typeId != DEBUG_STICK_ID)
68-
return;
6964
const player = getPlayerByID(ev.source.id);
7065
if (!player)
7166
return;
@@ -204,30 +199,6 @@ async function message(msg: string, player: Player) {
204199
});
205200
}
206201

207-
/**
208-
* Returns a player's currently held item
209-
* @param player The player
210-
* @returns ItemStack or undefined
211-
*/
212-
function getHeldItem(player: Player): ItemStack | undefined {
213-
return player
214-
.getComponent("minecraft:inventory")
215-
.container
216-
.getItem(player.selectedSlotIndex);
217-
}
218-
219-
/**
220-
* Queries whether a player is currently using the debug
221-
* stick item
222-
* @param player The player
223-
* @returns true if the player currently holds the debug
224-
* stick
225-
*/
226-
function isHoldingDebugStick(player: Player): boolean {
227-
return getHeldItem(player)
228-
?.typeId == DEBUG_STICK_ID;
229-
}
230-
231202
/**
232203
* Utility function to return a player class from an entity ID
233204
* @param id The entity ID

0 commit comments

Comments
 (0)