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

Babatunde

Members
  • Content Count

    15
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Babatunde

  • Rank
    Tree Puncher
  1. Intellij IDEA Ultimate. Oh nice! completely forgot about that line lmao. This is what I've got so far, I'm kinda stuck because I have no idea what to do: public class ChangeTabListEvents { private final Field fieldPlayers = ObfuscationReflectionHelper.findField(SPlayerListItemPacket.class, "field_179769_b"); private final Field fieldDisplayName = ObfuscationReflectionHelper.findField(SPlayerListItemPacket.AddPlayerData.class, "field_179965_e"); @SubscribeEvent public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) { PlayerEntit
  2. refreshDisplayName is from 1.12.2. A lot is the documentation is outdated. Thanks, I forgot that existed. I'm sorry, I've never worked with packets before. is there a tutorial or documentation on how to create packets?
  3. So, I've looked at reflection together with a friend of mine, but we could get it to work. We now have this: @SubscribeEvent public void onPlayerLogin(EntityJoinWorldEvent event) { if (event.getEntity() instanceof PlayerEntity) { PlayerEntity player = (PlayerEntity) event.getEntity(); if (player.getServer() != null) { ForgeEventFactory.getPlayerDisplayName(player, player.getGameProfile().getName()); try { Field field = ObfuscationReflectionHelper.findField(SPlayerListItemPacket.clas
  4. That doesn't seem to work for me 🤔 This is what I got rn: public class ChangeTabListEvents { @SubscribeEvent public void onNameFormat(PlayerEvent.NameFormat event) { if (event.getEntity() instanceof PlayerEntity) { event.setDisplayname(event.getUsername() + " (" + event.getPlayer().getMaxHealth() + ")"); event.getEntity().sendMessage(new KeybindTextComponent("NameFormat event fired.")); } } @SubscribeEvent public void onPlayerLogin(EntityJoinWorldEvent event) { if (event.getEntity() instanceof PlayerEntity) {
  5. How would I do this? I've never worked with packets before.
  6. Im not very familiar with client side mods but this should do the job: returns true if player is in Creative: Minecraft.getInstance().player.isCreative(); returns true if player is in Spectator: Minecraft.getInstance().player.isSpectator(); returns String of serverIP: Minecraft.getInstance().getCurrentServerData().serverIP;
  7. Hi everyone, I want to add a suffix to every players name, but I cant get it to work. I'm doing it like this: @SubscribeEvent public void onNameFormat(PlayerEvent.NameFormat event) { if (event.getEntity() instanceof PlayerEntity) { event.setDisplayname(event.getUsername() + " test"); } } If I use event.getDisplayname() it shows the name + test, but it doesn't change on the tab list. Do I need to somehow update the tab list for it to work or am I doing it completely wrong? Thanks!
  8. Hi Modders, I'm working on a mod where a player starts with 1 heart and every time they die they gain a heart until they have 10 hearts. But I struggling with how I save the amount a hearts the player has. If I put it in the player data, it will be deleted when the player dies. Same goes for capabilities. I've tried it with a Hashmap but I know its not the best way of doing thing so I'd like some feedback from you guys. Thanks.
  9. Hi Modders, I'm working on a mod where a player starts with 1 heart and every time they die they gain a heart until they have 10 hearts. But I struggling with how I save the amount a hearts the player has. If I put it in the player data, it will be deleted when the player dies. Same goes for capabilities. I've tried it with a Hashmap but I know its not the best way of doing thing so I'd like some feedback from you guys. Thanks. EDIT: I'm using 1.15.2 and 1.14.4.
  10. Ye, I've tried everything I could think of and I have done hours of research.
  11. I don't think there is a way to get the number of deaths with ServerPlayerEntity#getStats either
  12. You cant get the amount of deaths using the Stats class
  13. Hello Modders, Is there a way to get the number of deaths a player has from his statistics? MC version 1.15.2 I have been looking for a solution for hours but I cant find the answer.
×
×
  • Create New...

Important Information

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