MCPcopy Create free account
hub / github.com/cabaletta/baritone / hasSilkTouch

Method hasSilkTouch

src/main/java/baritone/utils/ToolSet.java:115–125  ·  view source on GitHub ↗
(ItemStack stack)

Source from the content-addressed store, hash-verified

113 }
114
115 public boolean hasSilkTouch(ItemStack stack) {
116 ItemEnchantments enchantments = stack.getEnchantments();
117 for (Holder<Enchantment> enchant : enchantments.keySet()) {
118 // silk touch enchantment is still special cased as affecting block drops
119 // not possible to add custom attribute via datapack
120 if (enchant.is(Enchantments.SILK_TOUCH) && enchantments.getLevel(enchant) > 0) {
121 return true;
122 }
123 }
124 return false;
125 }
126
127 /**
128 * Calculate which tool on the hotbar is best for mining, depending on an override setting,

Callers 1

getBestSlotMethod · 0.95

Calls 2

getLevelMethod · 0.80
isMethod · 0.65

Tested by

no test coverage detected