Skip to content

Commit aa12209

Browse files
committed
Added ItemFramePassThrough Hack
1 parent e72cd7f commit aa12209

File tree

4 files changed

+131
-0
lines changed

4 files changed

+131
-0
lines changed

README.md

448 Bytes

AutoDisenchant

  • Feeds items from your inventory (and or hotbar) that can be disenchanted into the grindstone automatically.

ItemFramePassThrough

  • You can now open chests that have item frames in the way!
  • Right-clicking item frames with items in them interacts with the block behind them. Hold sneak to interact with the frame normally.

ItemESP (Expanded)

Highlights dropped, equipped, and framed items with powerful filters and customization.

src/main/java/net/wurstclient/hack/HackList.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public final class HackList implements UpdateListener
117117
public final InvWalkHack invWalkHack = new InvWalkHack();
118118
public final ItemEspHack itemEspHack = new ItemEspHack();
119119
public final ItemGeneratorHack itemGeneratorHack = new ItemGeneratorHack();
120+
public final ItemFramePTHack itemFramePTHack = new ItemFramePTHack();
120121
public final JesusHack jesusHack = new JesusHack();
121122
public final JetpackHack jetpackHack = new JetpackHack();
122123
public final KaboomHack kaboomHack = new KaboomHack();
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
/*
2+
* Copyright (c) 2014-2025 Wurst-Imperium and contributors.
3+
*
4+
* This source code is subject to the terms of the GNU General Public
5+
* License, version 3. If a copy of the GPL was not distributed with this
6+
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
7+
*/
8+
package net.wurstclient.hacks;
9+
10+
import net.minecraft.entity.Entity;
11+
import net.minecraft.entity.decoration.ItemFrameEntity;
12+
import net.minecraft.item.ItemStack;
13+
import net.minecraft.util.hit.BlockHitResult;
14+
import net.minecraft.util.hit.EntityHitResult;
15+
import net.minecraft.util.hit.HitResult;
16+
import net.minecraft.util.math.Box;
17+
import net.minecraft.util.math.Vec3d;
18+
import net.wurstclient.Category;
19+
import net.wurstclient.events.RightClickListener;
20+
import net.wurstclient.hack.Hack;
21+
import net.wurstclient.util.BlockUtils;
22+
import net.wurstclient.util.EntityUtils;
23+
import net.wurstclient.util.RotationUtils;
24+
25+
/**
26+
* Forwards right-clicks on item frames that contain an item to the block
27+
* behind the frame (e.g. opens a chest behind an item frame). When the
28+
* player is sneaking the normal item-frame interaction is preserved.
29+
*/
30+
public final class ItemFramePTHack extends Hack implements RightClickListener
31+
{
32+
public ItemFramePTHack()
33+
{
34+
super("ItemFramePT");
35+
setCategory(Category.ITEMS);
36+
}
37+
38+
@Override
39+
protected void onEnable()
40+
{
41+
EVENTS.add(RightClickListener.class, this);
42+
}
43+
44+
@Override
45+
protected void onDisable()
46+
{
47+
EVENTS.remove(RightClickListener.class, this);
48+
}
49+
50+
@Override
51+
public void onRightClick(RightClickEvent event)
52+
{
53+
// Respect vanilla item use cooldown
54+
if(MC.itemUseCooldown > 0)
55+
return;
56+
57+
// Only when the use key is pressed
58+
if(!MC.options.useKey.isPressed())
59+
return;
60+
61+
HitResult hr = MC.crosshairTarget;
62+
if(hr == null)
63+
return;
64+
65+
EntityHitResult ehr = null;
66+
67+
if(hr.getType() == HitResult.Type.ENTITY)
68+
{
69+
ehr = (EntityHitResult)hr;
70+
}else if(hr.getType() == HitResult.Type.BLOCK)
71+
{
72+
// If the crosshair target is a block (common when looking at
73+
// frames),
74+
// try to find an item frame entity at the hit position.
75+
BlockHitResult bh = (BlockHitResult)hr;
76+
Vec3d hitPos = bh.getPos();
77+
for(Entity e : MC.world.getEntities())
78+
{
79+
if(!(e instanceof ItemFrameEntity))
80+
continue;
81+
ItemFrameEntity frame = (ItemFrameEntity)e;
82+
Box box = EntityUtils.getLerpedBox(frame, 0.0f);
83+
if(box.contains(hitPos))
84+
{
85+
ehr = new EntityHitResult(frame, frame.getPos());
86+
break;
87+
}
88+
}
89+
}
90+
91+
if(ehr == null)
92+
return;
93+
94+
if(!(ehr.getEntity() instanceof ItemFrameEntity frame))
95+
return;
96+
97+
ItemStack stack = frame.getHeldItemStack();
98+
if(stack == null || stack.isEmpty())
99+
return;
100+
101+
// If the player is sneaking, keep normal behavior
102+
if(MC.player.isSneaking())
103+
return;
104+
105+
// Raycast from the player's eyes past the entity hit position to find
106+
// the underlying block (the block the frame is attached to). We extend
107+
// the ray a bit past the frame so that the block behind the frame is
108+
// detected.
109+
Vec3d eyes = RotationUtils.getEyesPos();
110+
Vec3d target = ehr.getPos();
111+
Vec3d look = RotationUtils.getServerLookVec();
112+
double dist = eyes.distanceTo(target);
113+
double extend = 1.5; // extend beyond the frame
114+
Vec3d end = eyes.add(look.multiply(dist + extend));
115+
BlockHitResult bhit = BlockUtils.raycast(eyes, end);
116+
if(bhit == null || bhit.getType() != HitResult.Type.BLOCK)
117+
return;
118+
119+
// If the ray hit the face of the same block that the frame is attached
120+
// to,
121+
// use that block position. Otherwise fall back to the ray result.
122+
// (Mostly for clarity; bhit should already be correct.)
123+
// Cancel the normal item-frame interaction and interact with the
124+
// block behind the frame instead.
125+
event.cancel();
126+
IMC.getInteractionManager().rightClickBlock(bhit.getBlockPos(),
127+
bhit.getSide(), bhit.getPos());
128+
}
129+
}

src/main/resources/assets/wurst/translations/en_us.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
"description.wurst.hack.invwalk": "Allows you to move around while the inventory is open.",
9797
"description.wurst.hack.itemesp": "Highlights nearby items.",
9898
"description.wurst.hack.itemgenerator": "Generates random items and drops them on the ground.\n??oCreative mode only.??r",
99+
"description.wurst.hack.itemframept": "Right-clicking item frames with items in them interacts with the block behind them. Hold sneak to interact with the frame normally.",
99100
"description.wurst.hack.jesus": "Allows you to walk on water.\nJesus used this hack ~2000 years ago.",
100101
"description.wurst.hack.jetpack": "Allows you to fly as if you had a jetpack.\n\n??c??lWARNING:??r You will take fall damage if you don't use NoFall.",
101102
"description.wurst.hack.kaboom": "Breaks blocks around you like an explosion.\n\nCan be a lot faster than Nuker if the server doesn't have an anti-cheat plugin. It works best with fast tools and weak blocks.\n\nNote: This is not an actual explosion.",

0 commit comments

Comments
 (0)