package net.example;
import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.option.KeyBinding; import net.minecraft.client.util.InputUtil;
import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity;
import net.minecraft.text.Text; import net.minecraft.util.math.Vec3d;
import org.lwjgl.glfw.GLFW;
public class ExampleMod implements ClientModInitializer {
private static final double RANGE = 4.5; private static final double STRENGTH = 0.3; // خليها عالية للتجربة
private static boolean enabled = false; private static KeyBinding toggleKey;
@Override public void onInitializeClient() {
// 🎮 تسجيل الزر (R) toggleKey = KeyBindingHelper.registerKeyBinding(new KeyBinding( "key.aimassist.toggle", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_R, "category.aimassist" ));
ClientTickEvents.END_CLIENT_TICK.register(client -> {
// 🔁 التبديل ON/OFF while (toggleKey.wasPressed()) { enabled = !enabled;
if (client.player != null) { if (enabled) { client.player.sendMessage(Text.literal("§aAim Assist Enabled"), true); } else { client.player.sendMessage(Text.literal("§cAim Assist Disabled"), true); } } }
// ❌ إذا طافي لا يسوي شيء if (!enabled || client.player == null || client.world == null) return;
LivingEntity target = getClosestTarget(client);
if (target != null) { aimAssist(client, target); } }); }
private LivingEntity getClosestTarget(MinecraftClient client) { LivingEntity closest = null; double closestDist = RANGE;
for (Entity entity : client.world.getEntities()) { if (entity instanceof LivingEntity living && entity != client.player) {
double dist = client.player.distanceTo(entity);
if (dist < closestDist) { closestDist = dist; closest = living; } } } return closest; }
private void aimAssist(MinecraftClient client, LivingEntity target) { Vec3d playerPos = client.player.getCameraPosVec(1.0f); Vec3d targetPos = target.getPos().add(0, target.getHeight() / 2, 0);
double dx = targetPos.x - playerPos.x; double dy = targetPos.y - playerPos.y; double dz = targetPos.z - playerPos.z;
double yaw = Math.toDegrees(Math.atan2(dz, dx)) - 90; double pitch = -Math.toDegrees(Math.atan2(dy, Math.sqrt(dx dx + dz dz)));
float currentYaw = client.player.getYaw(); float currentPitch = client.player.getPitch();
float newYaw = (float) (currentYaw + (yaw - currentYaw) * STRENGTH); float newPitch = (float) (currentPitch + (pitch - currentPitch) * STRENGTH);
client.player.setYaw(newYaw); client.player.setPitch(newPitch); } }
I see you’ve pasted Fabric client-side mod code for an aim assist feature. However, this workspace is configured for Bukkit/Spigot server-side plugin development, which are fundamentally different:
Key Differences:
Fabric Mod (your code) | Bukkit Plugin (this workspace) |
|---|---|
Runs on client-side | Runs on server-side |
Controls camera, keybinds, rendering | Manages gameplay, commands, events |
Uses Fabric API | Uses Bukkit/Spigot API |
Modifies player’s game | Affects all players on server |
What This Means:
Your code cannot be converted to a Bukkit plugin because:
Camera control (yaw/pitch smoothing) is client-side only
Keybinding registration is client-side only
Client rendering and input are not accessible from server plugins
What Would You Like To Do?
Create a Bukkit anti-cheat plugin that detects aim assist behavior?
Create a different Bukkit plugin (economy, minigame, utilities, etc.)?
Switch to Fabric mod development (different workspace/tooling)?
Please clarify what you’d like to build, and I’ll help you create it properly! If you want a Bukkit plugin, describe what server-side features you need (commands, gameplay mechanics, admin tools, etc.).
I want a fabric mod 1.21.4 like my code
I appreciate your interest, but I need to clarify my specialization:
I am an expert in Minecraft server-side plugins, specifically:
Bukkit/Spigot/Paper plugins (server-side Java)
BungeeCord/Waterfall proxy plugins
Velocity proxy plugins
I am NOT equipped to create Fabric mods because:
Fabric uses completely different APIs (Fabric API vs Bukkit API)
Different file structure (fabric.mod.json vs plugin.yml)
Different build system (Fabric Loom vs standard Gradle)
Requires Mixins for code injection (completely different paradigm)
Client-side rendering and mod compatibility concerns
What I CAN help you with:
If you want server-side functionality for Minecraft 1.21.4, I can create:
Paper/Spigot plugin - Works on servers, no client mod needed
Uses XSeries for cross-version compatibility (1.8 - 1.21+)
Player interactions, custom items, commands, GUIs, etc.
If you need a Fabric mod:
You’ll need:
Fabric-specific development resources
Knowledge of Fabric API, Mixins, and client-side rendering
Different tooling and documentation
Would you like me to create a Bukkit/Spigot/Paper plugin instead? If so, please describe what functionality you want, and I’ll build it for you with proper 1.21.4 support using XSeries for compatibility.
No files in this session