diff --git a/bukkit-example-common/src/main/java/com/lunarclient/apollo/example/module/impl/InventoryExample.java b/bukkit-example-common/src/main/java/com/lunarclient/apollo/example/module/impl/InventoryExample.java index fa2995ac..27ffef3a 100644 --- a/bukkit-example-common/src/main/java/com/lunarclient/apollo/example/module/impl/InventoryExample.java +++ b/bukkit-example-common/src/main/java/com/lunarclient/apollo/example/module/impl/InventoryExample.java @@ -50,6 +50,8 @@ public void inventoryModuleCommandExample(Player player) { player.performCommand("summon item ~ ~1 ~ {Item:{id:\"minecraft:torch\",Count:1b,components:{\"minecraft:custom_name\":\"OPEN URL\",\"minecraft:custom_data\":{lunar:{unclickable:true,openUrl:\"https://lunarclient.com\"}}}}}"); player.performCommand("summon item ~ ~1 ~ {Item:{id:\"minecraft:book\",Count:1b,components:{\"minecraft:custom_name\":\"SUGGEST COMMAND\",\"minecraft:custom_data\":{lunar:{unclickable:true,suggestCommand:\"/apollo\"}}}}}"); player.performCommand("summon item ~ ~1 ~ {Item:{id:\"minecraft:writable_book\",Count:1b,components:{\"minecraft:custom_name\":\"RUN COMMAND\",\"minecraft:custom_data\":{lunar:{unclickable:true,runCommand:\"/apollo\"}}}}}"); + player.performCommand("summon item ~ ~1 ~ {Item:{id:\"minecraft:sponge\",Count:1b,components:{\"minecraft:custom_name\":\"HIDE ITEM TOOLTIP\",\"minecraft:custom_data\":{lunar:{unclickable:true,hideItemTooltip:true}}}}}"); + player.performCommand("summon item ~ ~1 ~ {Item:{id:\"minecraft:dirt\",Count:1b,components:{\"minecraft:custom_name\":\"HIDE SLOT HIGHTLIGHT\",\"minecraft:custom_data\":{lunar:{unclickable:true,hideSlotHighlight:true}}}}}"); } public void inventoryModuleNMSExample(Player player) { @@ -60,7 +62,7 @@ public void inventoryModuleNMSExample(Player player) { ChatColor.RED.toString() + ChatColor.BOLD + "UNCLICKABLE" ); - inventory.setItem(11, ItemUtil.addTag(unclickableItem, "unclickable", true)); + inventory.setItem(10, ItemUtil.addTag(unclickableItem, "unclickable", true)); ItemStack copyToClipboardItem = ItemUtil.itemWithName( Material.PAPER, @@ -68,7 +70,7 @@ public void inventoryModuleNMSExample(Player player) { ); copyToClipboardItem = ItemUtil.addTag(copyToClipboardItem, "unclickable", true); - inventory.setItem(14, ItemUtil.addTag(copyToClipboardItem, "copyToClipboard", "lunarclient.com")); + inventory.setItem(12, ItemUtil.addTag(copyToClipboardItem, "copyToClipboard", "lunarclient.com")); ItemStack openUrlItem = ItemUtil.itemWithName( Material.TORCH, @@ -76,7 +78,7 @@ public void inventoryModuleNMSExample(Player player) { ); openUrlItem = ItemUtil.addTag(openUrlItem, "unclickable", true); - inventory.setItem(17, ItemUtil.addTag(openUrlItem, "openUrl", "https://lunarclient.com")); + inventory.setItem(14, ItemUtil.addTag(openUrlItem, "openUrl", "https://lunarclient.com")); ItemStack suggestCommandItem = ItemUtil.itemWithName( Material.BOOK, @@ -84,7 +86,7 @@ public void inventoryModuleNMSExample(Player player) { ); suggestCommandItem = ItemUtil.addTag(suggestCommandItem, "unclickable", true); - inventory.setItem(29, ItemUtil.addTag(suggestCommandItem, "suggestCommand", "/apollo")); + inventory.setItem(16, ItemUtil.addTag(suggestCommandItem, "suggestCommand", "/apollo")); ItemStack runCommandItem = ItemUtil.itemWithName( Material.ENCHANTED_BOOK, @@ -92,7 +94,23 @@ public void inventoryModuleNMSExample(Player player) { ); runCommandItem = ItemUtil.addTag(runCommandItem, "unclickable", true); - inventory.setItem(33, ItemUtil.addTag(runCommandItem, "runCommand", "/apollo")); + inventory.setItem(29, ItemUtil.addTag(runCommandItem, "runCommand", "/apollo")); + + ItemStack hideTooltipItem = ItemUtil.itemWithName( + Material.SPONGE, + ChatColor.GRAY.toString() + ChatColor.BOLD + "HIDE ITEM TOOLTIP" + ); + + hideTooltipItem = ItemUtil.addTag(hideTooltipItem, "unclickable", true); + inventory.setItem(31, ItemUtil.addTag(hideTooltipItem, "hideItemTooltip", true)); + + ItemStack hideHighlightItem = ItemUtil.itemWithName( + Material.DIRT, + ChatColor.DARK_GRAY.toString() + ChatColor.BOLD + "HIDE SLOT HIGHTLIGHT" + ); + + hideHighlightItem = ItemUtil.addTag(hideHighlightItem, "unclickable", true); + inventory.setItem(33, ItemUtil.addTag(hideHighlightItem, "hideSlotHighlight", true)); player.openInventory(inventory); } diff --git a/docs/developers/modules/inventory.mdx b/docs/developers/modules/inventory.mdx index 10c51b00..35615fe2 100644 --- a/docs/developers/modules/inventory.mdx +++ b/docs/developers/modules/inventory.mdx @@ -12,6 +12,8 @@ The inventory module allows you to create customizable and professional user int - Ability to open URLs. (Respects chat privacy settings) - Ability to suggest & run commands. (Handled client-side) - Ability to copy to clipboard. + - Ability to hide item tooltips. + - Ability to hide slot highlighting. This module is disabled by default, if you wish to use this module you will need to enable it in `config.yml`. @@ -46,6 +48,14 @@ Explore each integration by cycling through each tab, to find the best fit for y `/summon item ~ ~1 ~ {Item:{id:"minecraft:writable_book",Count:1b,components:{"minecraft:custom_name":"RUN COMMAND","minecraft:custom_data":{lunar:{unclickable:true,runCommand:"/apollo"}}}}}` +**Hide Item Tooltip Item** + +`/summon item ~ ~1 ~ {Item:{id:"minecraft:sponge",Count:1b,components:{"minecraft:custom_name":"HIDE ITEM TOOLTIP","minecraft:custom_data":{lunar:{unclickable:true,hideItemTooltip:true}}}}}` + +**Hide Slot Highlight Item** + +`/summon item ~ ~1 ~ {Item:{id:"minecraft:dirt",Count:1b,components:{"minecraft:custom_name":"HIDE SLOT HIGHTLIGHT","minecraft:custom_data":{lunar:{unclickable:true,hideSlotHighlight:true}}}}}` + @@ -65,7 +75,7 @@ public void inventoryModuleNMSExample(Player player) { ChatColor.RED.toString() + ChatColor.BOLD + "UNCLICKABLE" ); - inventory.setItem(11, ItemUtil.addTag(unclickableItem, "unclickable", true)); + inventory.setItem(10, ItemUtil.addTag(unclickableItem, "unclickable", true)); ItemStack copyToClipboardItem = ItemUtil.itemWithName( Material.PAPER, @@ -73,7 +83,7 @@ public void inventoryModuleNMSExample(Player player) { ); copyToClipboardItem = ItemUtil.addTag(copyToClipboardItem, "unclickable", true); - inventory.setItem(14, ItemUtil.addTag(copyToClipboardItem, "copyToClipboard", "lunarclient.com")); + inventory.setItem(12, ItemUtil.addTag(copyToClipboardItem, "copyToClipboard", "lunarclient.com")); ItemStack openUrlItem = ItemUtil.itemWithName( Material.TORCH, @@ -81,7 +91,7 @@ public void inventoryModuleNMSExample(Player player) { ); openUrlItem = ItemUtil.addTag(openUrlItem, "unclickable", true); - inventory.setItem(17, ItemUtil.addTag(openUrlItem, "openUrl", "https://lunarclient.com")); + inventory.setItem(14, ItemUtil.addTag(openUrlItem, "openUrl", "https://lunarclient.com")); ItemStack suggestCommandItem = ItemUtil.itemWithName( Material.BOOK, @@ -89,7 +99,7 @@ public void inventoryModuleNMSExample(Player player) { ); suggestCommandItem = ItemUtil.addTag(suggestCommandItem, "unclickable", true); - inventory.setItem(29, ItemUtil.addTag(suggestCommandItem, "suggestCommand", "/apollo")); + inventory.setItem(16, ItemUtil.addTag(suggestCommandItem, "suggestCommand", "/apollo")); ItemStack runCommandItem = ItemUtil.itemWithName( Material.ENCHANTED_BOOK, @@ -97,7 +107,23 @@ public void inventoryModuleNMSExample(Player player) { ); runCommandItem = ItemUtil.addTag(runCommandItem, "unclickable", true); - inventory.setItem(33, ItemUtil.addTag(runCommandItem, "runCommand", "/apollo")); + inventory.setItem(29, ItemUtil.addTag(runCommandItem, "runCommand", "/apollo")); + + ItemStack hideTooltipItem = ItemUtil.itemWithName( + Material.SPONGE, + ChatColor.GRAY.toString() + ChatColor.BOLD + "HIDE ITEM TOOLTIP" + ); + + hideTooltipItem = ItemUtil.addTag(hideTooltipItem, "unclickable", true); + inventory.setItem(31, ItemUtil.addTag(hideTooltipItem, "hideItemTooltip", true)); + + ItemStack hideHighlightItem = ItemUtil.itemWithName( + Material.DIRT, + ChatColor.DARK_GRAY.toString() + ChatColor.BOLD + "HIDE SLOT HIGHTLIGHT" + ); + + hideHighlightItem = ItemUtil.addTag(hideHighlightItem, "unclickable", true); + inventory.setItem(33, ItemUtil.addTag(hideHighlightItem, "hideSlotHighlight", true)); player.openInventory(inventory); }