Jump to content
  • Home
  • Files
  • Docs
Status Updates
  • All Content

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • kyazuki

kyazuki

Members
 View Profile  See their activity
  • Content Count

    110
  • Joined

    January 23, 2020
  • Last visited

    December 28, 2020

Community Reputation

5 Neutral

About kyazuki

  • Rank
    Creeper Killer

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. kyazuki

    [Solved][1.16.1]Fire CustomPlayerEvent every 10 sec.

    kyazuki replied to kyazuki's topic in Modder Support

    Thanks! @SubscribeEvent public static void time(TickEvent.PlayerTickEvent event) { if (event.side == LogicalSide.SERVER && event.phase == TickEvent.Phase.END) { if (event.player.getEntityWorld().getGameTime() % 200 == 0){ MinecraftForge.EVENT_BUS.post(new MyModEvents.CustomPlayerEvent(player)); } } }
    • October 19, 2020
    • 2 replies
  2. kyazuki started following [1.16.1]Not translate TranslationTextComponent on console, [Solved][1.16.1]Fire CustomPlayerEvent every 10 sec., [Solved][1.16.1]Get players in render range. and and 1 other October 19, 2020
  3. kyazuki

    [Solved][1.16.1]Fire CustomPlayerEvent every 10 sec.

    kyazuki posted a topic in Modder Support

    I want to fire CustomPlayerEvents of all players every 10 seconds. I count 10 sec in ServerTickEvent, but I can't get playerlist in the event. So I use WorldTickEvent. However I guess this code causes bug when players are in different dimensions. How do I fix this? My code: private static int time = 200; @SubscribeEvent public static void calc(TickEvent.ServerTickEvent event) { time--; } @SubscribeEvent public static void time(TickEvent.WorldTickEvent event) { if (event.side == LogicalSide.SERVER) { if (time <= 0) { time = 200; // I guess this is called each dimension. for (PlayerEntity player : event.world.getServer().getPlayerList().getPlayers()) { MinecraftForge.EVENT_BUS.post(new MyModEvents.CustomPlayerEvent(player)); } } } }
    • October 19, 2020
    • 2 replies
  4. kyazuki

    [Solved][1.16.1]Get players in render range.

    kyazuki replied to kyazuki's topic in Modder Support

    It works! Thank you!
    • August 11, 2020
    • 6 replies
  5. kyazuki

    [Solved][1.16.1]Get players in render range.

    kyazuki replied to kyazuki's topic in Modder Support

    I'm sorry, I'm bad at English. So I think my explanation was a little confusing. I want clients to hold capabilities related to each of the players in the server, but this data is reset upon moving dimensions. I want to solve this. Now, I'm sending capabilities of all players to any player moving dimensions. However I need to send capabilities only of the players in render range. This is why I want to have a client fetch data from the server about players in render range. Is TRACKING_ENTITY still the solution? If so, how can I use it to achieve this?
    • August 11, 2020
    • 6 replies
  6. kyazuki

    [Solved][1.16.1]Get players in render range.

    kyazuki replied to kyazuki's topic in Modder Support

    I know TRACKING_CHUNK/ENTITY, but it's opposite. I want to send tracked players data to a tracking client.
    • August 10, 2020
    • 6 replies
  7. kyazuki

    [Solved][1.16.1]Get players in render range.

    kyazuki posted a topic in Modder Support

    Can I get players in render range? I want to send packets of players in render range to client.
    • August 10, 2020
    • 6 replies
  8. kyazuki

    [1.16.1]What is this error?

    kyazuki posted a topic in Modder Support

    Server shows these error when players login, change dimension or respawn. Singleplay doesn't show them. I think they are caused by my capablitiy or packet. Code: https://github.com/kyazuki/DietMod/tree/1.16.x-forge/src/main/java/com/github/kyazuki/dietmod Error:
    • August 9, 2020
    • 1 reply
  9. kyazuki

    [Solved][1.16.1]Client works, but server crashes at packet handler.

    kyazuki replied to kyazuki's topic in Modder Support

    I see. Thank you for pointing it out!
    • August 9, 2020
    • 14 replies
  10. kyazuki

    [Solved][1.16.1]Client works, but server crashes at packet handler.

    kyazuki replied to kyazuki's topic in Modder Support

    Is this correct? Entity player = Minecraft.getInstance().world.getEntityByID(playerEntityID); if (player == null || !(player instanceof PlayerEntity)) return;
    • August 9, 2020
    • 14 replies
  11. kyazuki

    [1.16.1]Not translate TranslationTextComponent on console

    kyazuki replied to kyazuki's topic in Modder Support

    I see. Thank you!
    • August 9, 2020
    • 4 replies
  12. kyazuki

    [Solved][1.16.1]Client works, but server crashes at packet handler.

    kyazuki replied to kyazuki's topic in Modder Support

    It works! Thanks for the help! public static void handle(CapabilityPacket pkt, Supplier<NetworkEvent.Context> contextSupplier) { NetworkEvent.Context context = contextSupplier.get(); context.enqueueWork(() -> DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> Handle.handleClient(pkt.playerEntityID, pkt.scale))); context.setPacketHandled(true); } public static class Handle { public static DistExecutor.SafeRunnable handleClient(int playerEntityID, float scale) { return new DistExecutor.SafeRunnable() { @Override public void run() { PlayerEntity player = (PlayerEntity) Minecraft.getInstance().world.getEntityByID(playerEntityID); if (player == null) return; player.getCapability(ScaleProvider.SCALE_CAP).orElseThrow(IllegalArgumentException::new).setScale(scale); } }; } }
    • August 9, 2020
    • 14 replies
  13. kyazuki

    [Solved][1.16.1]Client works, but server crashes at packet handler.

    kyazuki replied to kyazuki's topic in Modder Support

    Yes, but it causes server crash... https://github.com/kyazuki/DietMod/blob/37d228d98922fb2d498414dcd2db04f744a2b8f1/src/main/java/com/github/kyazuki/dietmod/network/CapabilityPacket.java#L29
    • August 9, 2020
    • 14 replies
  14. kyazuki

    [1.16.1]Not translate TranslationTextComponent on console

    kyazuki replied to kyazuki's topic in Modder Support

    I can't translate on console? Vanilla commands are translated on console, so I assumed I can.
    • August 9, 2020
    • 4 replies
  15. kyazuki

    [Solved][1.16.1]Client works, but server crashes at packet handler.

    kyazuki replied to kyazuki's topic in Modder Support

    Context#getSender()? I want to change ClientPlayer capability. getSender() returns ServerPlayerEntity...
    • August 9, 2020
    • 14 replies
  16. kyazuki

    [1.16.1]Not translate TranslationTextComponent on console

    kyazuki posted a topic in Modder Support

    I add a custom command. Its feedback is translated correctly on chat. However, console shows only translationKey. How do I fix? @SubscribeEvent public static void onCommandsRegister(RegisterCommandsEvent event) { SetDistanceCommand.register(event.getDispatcher()); } public class SetDistanceCommand { public static void register(CommandDispatcher<CommandSource> dispatcher) { dispatcher.register(Commands.literal("setdistance") .requires(source -> source.hasPermissionLevel(2)) .then(Commands.argument("blocks", IntegerArgumentType.integer(10, 100000)) .executes(context -> { int value = IntegerArgumentType.getInteger(context, "blocks"); TestModConfig.distanceToNormal = value; context.getSource().sendFeedback(new TranslationTextComponent("commands.testmod.setdistance", value), true); return 0; }))); } }
    • August 9, 2020
    • 4 replies
  • All Activity
  • Home
  • kyazuki
  • Theme

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