Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Get's nickname of a player
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
sayonara2312

Get's nickname of a player

By sayonara2312, November 4, 2018 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

sayonara2312    0

sayonara2312

sayonara2312    0

  • Tree Puncher
  • sayonara2312
  • Members
  • 0
  • 1 post
Posted November 4, 2018

How can I get the nickname of a player who hits with his hand at the time of using the command?

  • Quote

Share this post


Link to post
Share on other sites

m00nl1ght    2

m00nl1ght

m00nl1ght    2

  • Tree Puncher
  • m00nl1ght
  • Members
  • 2
  • 22 posts
Posted November 4, 2018

1. What do you mean by "using the command"? Are you trying to create a command?

2. What do you mean by "a player who hits with his hand"? A player who is interacting with something?

Please explain what you are trying to archieve.

  • Quote

Share this post


Link to post
Share on other sites

JimiIT92    20

JimiIT92

JimiIT92    20

  • Dragon Slayer
  • JimiIT92
  • Members
  • 20
  • 745 posts
Posted November 4, 2018

Wheter "using the command" means actually using a command like /something or it means the players does some sort of action (like attacking an entity), you should have an event handler for these events and in that i'm pretty sure you'll find a reference to the player, wich then will give you access to all players informations, like the name in this case.  You can find more about how to intercept an event here on the official Forge documentation. Note that this will give you the basics, for more advanced things you have to figure out by your own ;)

  • Quote

Don't blame me if i always ask for your help. I just want to learn to be better :)

Share this post


Link to post
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.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      [1.16.4] How i can open a container by clicking on my mob

      By diesieben07 · Posted 16 minutes ago

      When calling openGui, write the entity ID (Entity#getEntityId) to the PacketBuffer. Then in your IContainerFactory read it back from the buffer and use World#getEntityByID to get the entity.
    • XenoPyax
      [1.16.4] Replace vanilla block texture

      By XenoPyax · Posted 27 minutes ago

      my bad I was looking at the wrong project, it was my 1.8 project found it in the 1.16 one thanks!  
    • XenoPyax
      [1.16.4] Replace vanilla block texture

      By XenoPyax · Posted 28 minutes ago

      this is all I could find in TextureAtlasSprite : TextureUtil.uploadTextureMipmap
    • Klarks
      [1.16.4] How i can open a container by clicking on my mob

      By Klarks · Posted 28 minutes ago

      Ok i messed up few things, idk where did i get a player inventory parameter in openGui. So thanks it's working now But how i can correctly get the entity inside the container class to get capabilities to add a slot. I know how to do it with the player i can just get the player from the player inventory but with a mob i am not sure. Should i get the entity from world somehow?  
    • basicsid
      [1.16.4] Looking to add trades to villagers/wandering traders

      By basicsid · Posted 33 minutes ago

      Essentially I'm looking to add a trade option for either villagers or the wandering traders. Most of the resources I've found online are either several versions out of date, or are for the Fabric API.   Any pointers would be greatly appreciated!
  • Topics

    • Klarks
      25
      [1.16.4] How i can open a container by clicking on my mob

      By Klarks
      Started Saturday at 09:56 PM

    • XenoPyax
      6
      [1.16.4] Replace vanilla block texture

      By XenoPyax
      Started 2 hours ago

    • basicsid
      0
      [1.16.4] Looking to add trades to villagers/wandering traders

      By basicsid
      Started 34 minutes ago

    • LK1905
      24
      [1.16.4] How do I correctly sync capability data between Client and server?

      By LK1905
      Started December 31, 2020

    • TeamDman
      2
      [1.16.4] onBlockAdded being called twice on server side

      By TeamDman
      Started 2 hours ago

  • Who's Online (See full list)

    • Choonster
    • diesieben07
    • XenoPyax
    • monkeysHK
    • LexManos
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Get's nickname of a player
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community