Everything posted by Draconwolver
-
[1.11.2] [SOLVED] Cancel Render of EntityItems
Quite simply, I am trying to create a client-side only mod that will allow the user to hide certain entities from their view by preventing them from being rendered. Is there one specific event within Forge that would allow me to cancel the rendering of any entity? RenderPlayerEvent::Pre appears to be able to be used to prevent the rendering of players, but I am unsure of how to use RenderLivingEvent, and I see no event relating to the rendering of nonliving entities such as items. RenderTickEvent seems to not have any way of getting the entities that will be/were rendered in that tick. Any help is much appreciated. Thank you!
-
[1.8.9] Clientside Chunk Unloader
Would there be another way, such as just tossing out incoming packets that update the chunk?
-
[1.8.9] Clientside Chunk Unloader
It's just for recreational purposes, I want a way to artificially lag myself.
-
[1.8.9] Clientside Chunk Unloader
This works to an extent, but I don't think it is what I was looking for. The chunk unloads, but my client is still able to stand on the unloaded blocks and select them: Is there a way to mimic the effect of "lagging out" on servers where chunks are unloaded and all the blocks in them?
-
[1.8.9] Clientside Chunk Unloader
This may be an odd request, but how would I make a clientside mod that keeps chunks unloaded (prevents them from loading)? Since ChunkEvent.Load cannot be cancelled, I tried using Chunk#setChunkLoaded(false) from within, but that doesn't do anything.
-
[SOLVED][1.8.9] Multiplayer Anti-AFK
Thank you for your continued support! From your example I realized that perhaps I was using the wrong event. I was trying to change the player's rotation while in a KeyInputEvent, so I used some workarounds and got it working in a ClientTickEvent. Although it's strange that the player's direction can't be set in a KeyInputEvent... My original question has been answered, but on a side note, is there any benefit to checking that event.phase == TickEvent.Phase.END in the ClientTickEvent?
-
[SOLVED][1.8.9] Multiplayer Anti-AFK
Thanks, but after just trying the Entity#setAngles way, I have the same issue: My screen only shows me changing pitch/yaw when I move or press a key on my keyboard. If I am stationary in-game and have a pitch/yaw updater every tick, nothing happens. I think your block method works because the player has to move to touch the block. UPDATE: I am currently working around this by using a robot to hold down a generally unused key like KeyEvent.VK_BACK_SLASH. Of course, this would make the mod incompatible with users or mods who have the backslash key in their controls.
-
[SOLVED][1.8.9] Multiplayer Anti-AFK
Is there a way to prevent the player from being kicked on a multiplayer server for being AFK? For clarity and organizational purposes, let's assume that AFK is defined as "pitch and yaw not changing for two minutes." I have tried using a loop called every tick to change player.rotationPitch and player.rotationYaw, but these don't force my screen to look in that direction like they should. They only change the pitch and yaw when I press a key on my keyboard. So again, is there a way to let the server know that my pitch and yaw are changing? Would this require packets? Thanks!
-
[1.8.8] Forcing Player to Walk
Hello, I am trying to use keybinds to make the player walk, something that I thought would be quite simple. I have tried the following: [spoiler=MovementTask] public class MovementTask extends TimerTask { private final GameSettings gameSettings; private final long period; private final long walkingTime; public MovementTask(Minecraft minecraft, long period, long walkingTime) { this.gameSettings = minecraft.gameSettings; this.period = period; this.walkingTime = walkingTime; } @Override public void run() { int forward = gameSettings.keyBindForward.getKeyCode(); int right = gameSettings.keyBindRight.getKeyCode(); int back = gameSettings.keyBindBack.getKeyCode(); int left = gameSettings.keyBindLeft.getKeyCode(); int[] keyCodes = {forward, right, back, left}; for (int keyCode : keyCodes) { long oldTime = System.currentTimeMillis(); while (System.currentTimeMillis() - oldTime < walkingTime) { KeyBinding.setKeyBindState(keyCode, true); } KeyBinding.setKeyBindState(keyCode, false); } try { Thread.sleep(period); } catch (InterruptedException e) { e.printStackTrace(); } } } However, when I initiate this code properly with a Timer, the player's movement is not affected at all. I have tried other key bindings such as "key.use" and that seems to work fine. Any help is much appreciated, Draconwolver
-
[SOLVED][1.8.8][Multiplayer] Catching Chat Clientside
I'm not on my modding computer at the moment, so my apologies, but are you suggesting that CommandEvent works on multiplayer servers and can be cancelled to prevent sending the command?
-
[RESOLVED][1.8.8][Multiplayer] Obtaining World Name
Are you saying that the world name, like the seed, is not available to clients by default?
-
[RESOLVED][1.8.8][Multiplayer] Obtaining World Name
I would like to know if it is possible to obtain the current world's name in multiplayer (probably something to do with packets). I know that in singleplayer the server code handles world data and information about the world, but how would I receive/interpret data from a multiplayer server to get the world name? Thank you!
-
[SOLVED][1.8.8][Multiplayer] Catching Chat Clientside
I am trying to develop a mod that takes input from a user through chat, therefore cancelling the chat message and doing whatever with what they said. I have tried using the ServerChatEvent, but cancelling it only works in singleplayer. Any help is much appreciated!
-
[1.8.0] Multiplayer Working with Packets
I'm sorry, I don't really understand what you're trying to say. Doesn't running code from server-side only work in singleplayer worlds when the server is also local? I thought that when using a mod on a multiplayer server hosted elsewhere server code doesn't work.
-
[1.8.0] Multiplayer Working with Packets
Hello, I am currently working on a simple mod which gathers data about mobs in the world and says it in chat to the player. The way I am going about this is by using Minecraft.getMinecraft().theWorld.getLoadedEntityList() and then calling Entity#getCustomNameTag() to get the entity's name. This works perfectly on singleplayer and multiplayer, except when the server uses packets to fake mobs. Is there any way to detect packet-mobs and then gather data on them?
-
[1.7.10] Hiding Living Entities
I was wondering how to hide a mob from the player (client-side). I don't mean giving it an invisibility effect, but I mean preventing the player from rendering it in the first place. I have some code below which is supposed to hide pigs when the player presses M, but doesn't do anything at all: [spoiler=Hidden]Main Class: package draconwolver.main; import net.minecraft.client.settings.KeyBinding; import org.lwjgl.input.Keyboard; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLPreInitializationEvent; @Mod(modid = Mod.ID, name = Mod.NAME, version = Mod.VERSION) public class Mod { public static final String ID = "mod"; public static final String NAME = "Mod"; public static final String VERSION = "1.7.10-1.0"; public static KeyBinding key; @EventHandler public static void PreLoad(FMLPreInitializationEvent PreEvent) { key = new KeyBinding("Mod", Keyboard.KEY_M, "key.categories.misc"); ClientRegistry.registerKeyBinding(key); FMLCommonHandler.instance().bus().register(new KeyInputHandler()); } } Event Class: package draconwolver.main; import net.minecraft.client.Minecraft; import net.minecraft.client.settings.KeyBinding; import net.minecraftforge.client.event.RenderLivingEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class KeyInputHandler { private static KeyBinding key = Mod.key; private static boolean bool = false; @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { if(key.isPressed()) bool = !bool; } @SubscribeEvent public void onRenderLiving(RenderLivingEvent.Pre event) { if(bool && event.entity instanceof EntityPig) { event.setCanceled(true); Minecraft.getMinecraft().thePlayer.sendChatMessage("It works!"); } } } All help is appreciated, thank you!
IPS spam blocked by CleanTalk.