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

3mptysl

Members
  • Posts

    38
  • Joined

  • Last visited

Recent Profile Visitors

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

3mptysl's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  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.
×
×
  • Create New...

Important Information

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