Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Hide Player [1.8.9]


#ÖCT
 Share

Recommended Posts

Can you please help me one more time :o?

Is this correct?

And what must I send with the ImessageComponent?

 

package oect.lwaltens.luckyblockoectarmor.commands;

import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.Queue;
import java.util.UUID;

import org.apache.http.impl.conn.tsccm.WaitingThread;
import org.omg.CORBA.PRIVATE_MEMBER;

import com.google.common.collect.Lists;
import com.jcraft.jogg.Buffer;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;


import io.netty.buffer.ByteBuf;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityOtherPlayerMP;
import net.minecraft.client.multiplayer.PlayerControllerMP;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.CommandKill;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.NetHandlerPlayServer;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.server.S13PacketDestroyEntities;
import net.minecraft.network.play.server.S38PacketPlayerListItem;
import net.minecraft.network.play.server.S38PacketPlayerListItem.Action;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.gui.PlayerListComponent;
import net.minecraft.server.management.UserList;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IChatComponent;
import net.minecraft.world.World;
import net.minecraft.world.WorldSettings;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import oect.lwaltens.luckyblockoectarmor.LuckyBlockOect;
import scala.actors.remote.SendTo;
import scala.collection.parallel.ParIterableLike.Min;


public class Command_Tab_Remove extends CommandBase {
    
    public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("luckyblockoect");
    public NetHandlerPlayServer playerNetServerHandler;
    
    @Override
    public boolean canCommandSenderUseCommand(ICommandSender sender) {
        return true;
    } 

    @Override
    public String getCommandName() {
        return "hide_player";
    }

    @Override
    public String getCommandUsage(ICommandSender sender) {
        return "/hide_player"; 
    }
    
        public IChatComponent getTabListDisplayName() {
        return null;
    }
    

    @Override
    public void processCommand(ICommandSender sender, String[] args) throws CommandException {
        
        
         Minecraft.getMinecraft().ingameGUI.getTabList().setHeader(new ChatComponentText("Alle sind Cool"));
            if (sender instanceof EntityPlayer) {
                EntityPlayer player = (EntityPlayer) sender;

                
           
                if  (args.length == 1){
                     Entity entity = func_175768_b(sender, args[0]);
                     if (entity instanceof EntityPlayer) {
                         EntityPlayer hide_player = (EntityPlayer) entity;
                         
                         
                         
                         
                         String username = hide_player.getDisplayNameString();
                        EntityPlayerMP profile = MinecraftServer.getServer().getConfigurationManager().getPlayerByUsername(username);
                        INSTANCE.sendTo(message, sender);
                      
                       
                         
                 
                     }
                } 
                else {
                    player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED+"ERROR"));
                }
                   }    
            

            
    }
    
    public boolean isUsernameIndex(String[] args, int index)
    {
        return index == 0;
    }

    public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos)
    {
        return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null;
    }
     
}

Link to comment
Share on other sites

Please use the code tag:

Capture.PNG

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

1 minute ago, #ÖCT said:

Is it "processPacket"?

Jesus lord have mercy. Have you ever done any programming before?

 

I told you which packet you need (SPacketPlayerListItem). Open this class in your IDE and do a search for references. You will find some places where new instances of this class are created and sent to players. It is very obvious.

Link to comment
Share on other sites

Have a look at

net.minecraft.server.management.PlayerInteractionManager

  • Thanks 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

I'm very new in Forge modding. The Basics i can do, but I think that what i wanna to too complicated for me...

 

But I try to figure that out, i wanna to learn programming...

I'm only 13 years old, sorry that I annoy you, but I wanna to figure that out!!!

 

Link to comment
Share on other sites

2 minutes ago, #ÖCT said:

I'm very new in Forge modding. The Basics i can do, but I think that what i wanna to too complicated for me...

 

But I try to figure that out, i wanna to learn programming...

I'm only 13 years old, sorry that I annoy you, but I wanna to figure that out!!!

 

You should probably start off small - learning how to create an item, then a block, then textures, then recipes, then tile entities and capabilities and then network events.

 

If you follow that process you will know enough to do what your trying to do.

 

Have you looked up how other mods add commands? Their code would probably be very similar to any code that your trying to create

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

12 minutes ago, Cadiboo said:

You should probably start off small - learning how to create an item, then a block, then textures, then recipes, then tile entities and capabilities and then network events.

 

If you follow that process you will know enough to do what your trying to do.

 

Have you looked up how other mods add commands? Their code would probably be very similar to any code that your trying to create

Blocks, Items,Textures, Recipes are no Problem for me, you can sea my projects in the Video of Benx. 

Tile-Entities i have done with a tutorial...

Edited by #ÖCT
Link to comment
Share on other sites

1 minute ago, #ÖCT said:

Tile Entities are no Problem for me

Have you done Tile Entities with Capabilities and Network Handlers?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

1 minute ago, #ÖCT said:

For the Tile-Entities I used a tutorial and change the block for my things, further i haven`t got any idea how does it exactly works... :(

 

Advanced Tile Entities (stuff like modded furnaces etc) use forges Capability system which would be helpful for you to know, but not necessary.

 

TileEntities are synced between the Server and Client using Network event, You should learn how these work as they are similar to what you are trying to use

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

I Don't really know how to help, try having a look at this

 

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share




  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Hello There! We are back today with some more Super Craft Bros and this time it's spooky edition! I just want to clarify there is nothing spooky about this it's just us in Halloween skins playing spooky themed maps. There are some pretty funny moments in this video that I know you guys are gonna love! I hope you all enjoy this video and if you did please consider subscribing and while you are at it give the video a like!  
    • Can you send the debug file from the logs folder?
    • So I'm making a custom container but I get the following error when I right click the block [20:28:58] [Render thread/WARN]: Failed to create screen for menu type: ewanmod:rune_pedestal code is here: https://pastebin.com/6g0E2p93
    • I have been following every solution I can from other threads, but nothing has seemed to work so far. My graphics card is a GTX 1650 as well, if that's the problem.  Here is my Launcher Log: https://pastebin.com/0EduJiS9 And here is the report from the 'latest' file in the logs: https://pastebin.com/CsiVmhWS Any sort of help would be much obliged 
    • Ok so what am I supposed to do cause for now there isn't any mod but I'm gonna add mods on the server when it's gonna work. I removed all the mods on my side and on the server and it didn't worked. Maybe my server.properties isn't correct ? #Minecraft server properties #Thu Oct 21 18:17:44 EDT 2021 spawn-protection=16 max-tick-time=60000 query.port=25565 generator-settings= sync-chunk-writes=true force-gamemode=false allow-nether=true enforce-whitelist=false gamemode=survival broadcast-console-to-ops=true enable-query=false player-idle-timeout=0 text-filtering-config= difficulty=easy spawn-monsters=true broadcast-rcon-to-ops=true op-permission-level=4 pvp=true entity-broadcast-range-percentage=100 snooper-enabled=true allow-cheats=true level-type=biomesop hardcore=false enable-status=true enable-command-block=true max-players=20 network-compression-threshold=256 resource-pack-sha1= max-world-size=29999984 function-permission-level=4 rcon.port=25575 server-port=25565 server-ip= spawn-npcs=true allow-flight=false level-name=Serveur view-distance=10 resource-pack= spawn-animals=true white-list=false rcon.password= generate-structures=true max-build-height=256 online-mode=true level-seed= prevent-proxy-connections=false use-native-transport=true enable-jmx-monitoring=false enable-rcon=false rate-limit=0 motd=Bienvenue dans le serveur de PatateDouce45
  • Topics

  • Who's Online (See full list)

    There are no registered users currently online

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.