Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

3mptysl

Members
  • Joined

  • Last visited

  1. Yes idk. i look TickEvent.ServerTickEvent class and i didnt see how i take MinecraftServer, because if i use WorldTickEvent i can take server with event.world.getServer() maybe i'm tired and i don't see it.
  2. Okayy, thats works perfect and how can i get MinecraftServer in ServerTickEvent, its possible?
  3. or i need to change the value reading and writing de json?
  4. Okay, i did the access transformer and now how i get the player by uuids, because i need to restart a stats and i need a player parameter, i try to create a Player.createPlayerUUID(uuids) but i think is not the correct form.
  5. I don't know how to use accesstransformers, I have put this in my accesstransformer.cfg: public net.minecraft.world.level.storage.PlayerDataStorage <init>(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;Lcom/mojang/datafixers/DataFixer;)V # PlayerDataStorage but I still don't know what I should do since the server.playerDataStorage doesn't exist idk. what i need to put in accesstranformer.cfg? and how do i get playerDataStorage?
  6. I need to ban a person when they have played 6 hours in a day and when the day is over, reset the time played so that they can play again. I have done it through a stats timeplayed when it reaches 6h it bans you and resets your time played but I don't know how to make it unban you when the day is over and also if you haven't been banned I reset your stat
  7. Im using this but doesnt work @SubscribeEvent public static void serverStart(ServerStartedEvent event) { MinecraftServer server = event.getServer(); Stat<ResourceLocation> stat = Stats.CUSTOM.get(StatsInit.MY_PLAY_TIME.get()); server.getPlayerList().getPlayers().forEach(serverPlayer -> serverPlayer.resetStat(stat)); }
  8. if i use player stats i need to set a value. how i setvalue? im using player.getstats().setvalue(What i put here?); i need Play Time = 0
  9. how i create a timer for every player?, i use value = Dist.Dedicated_Server, i dont need it in local player. but it works in Servers but only in 1 player because all players re updating the same timer
  10. @SubscribeEvent public static void timerEventKick(TickEvent.PlayerTickEvent event) throws ParseException { ServerPlayer player = (ServerPlayer) event.player; System.err.println(timerToKick); if (event.phase == TickEvent.Phase.END){ timerToKick++; System.err.println(timerToKick); } if (event.phase == TickEvent.Phase.END && timerToKick == 200) { timerToKick = 0; UserBanList userbanlist = player.getServer().getPlayerList().getBans(); GameProfile gameprofile = player.getGameProfile(); Date date = date(); UserBanListEntry userbanlistentry = new UserBanListEntry(gameprofile, null, player.getName().getContents(), (Date)date, ""); userbanlist.add(userbanlistentry); player.connection.disconnect(new TextComponent("SE TE ACABO EL TIEMPO").withStyle(ChatFormatting.RED)); }
  11. I need help to do this well, I have managed to get the program to ban when a specific time passes but it works 1 in 1 and I need it to count the time players spend on the server and if he exceeds a certain number of hours temporarily ban him. I got the ban but it doesn't control more than one player at a time
  12. im modding a server side mod i need to ban a player who has reached the time limit player, im counting player ticks and then kick him but idk how ban him
  13. I have searched and I have come to the conclusion that I need to use a TickHandler but I don't know how to implement it in the context of my action, I need that when a player uses an item in a block, it removes the item on the fly and, after some time passes, spawns at the coordinates of the block.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.