Issue when using dataFolder on Java plugin - cannot find where the folder is saved

Discussion in 'Plugin Development' started by caledonian26, Dec 7, 2022.

Thread Status:
Not open for further replies.
  1. Offline

    caledonian26

    I have the following code (Java programming language, Bukkit/Spigot API).

    I would like to save the output (player coordinates) of the minecraft game into a file named player.log.

    Thus, if my player username was 'abce', the name of the file should be 'abce.log'.

    However, I can't find where on my server this file has been stored - it is not in the plugins folder where I would like it to be.

    I have attached a screenshot below of where I would like the file to be saved (which is remotely in an external shock-byte server plugins folder).

    I would be so grateful for a helping hand!

    Code:
    package newestfile.here.newestplugin;
    
    import java.util.UUID;
    import java.nio.charset.StandardCharsets;
    import java.nio.file.StandardOpenOption;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.HashMap;
    import java.io.File;
    import org.bukkit.event.player.PlayerQuitEvent;
    import org.bukkit.event.EventHandler;
    import org.bukkit.entity.Player;
    import org.bukkit.Location;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.Bukkit;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.scheduler.BukkitTask;
    import java.nio.file.Files;
    
    public class Main extends JavaPlugin implements Listener
    {
        boolean stopRepeater;
        HashMap<UUID, BukkitTask> tasks = new HashMap<>();
        private File dataFolder;
      
        public void onEnable() {
            Bukkit.getServer().getPluginManager().registerEvents(this,this);
            getLogger().info("HELLO! WELCOME TO THE TRACKER PLUGIN");
            dataFolder = new File(getDataFolder(), "data");
            dataFolder.mkdirs();
        }
      
        @EventHandler
        public void onLogin(final PlayerJoinEvent event) {
            final Player thePlayer = event.getPlayer();
            this.stopRepeater = true;
            final Location playerSpawnLocation = thePlayer.getLocation();
            getLogger().info("Welcome " + thePlayer.getName() + ". Your current position is: " + playerSpawnLocation);
            BukkitTask task = getServer().getScheduler().runTaskTimer(this, () -> {
                if(this.stopRepeater) {
                    this.logToFile(thePlayer, thePlayer.getLocation());
                }
            }, 0L, 20L);
            tasks.put(thePlayer.getUniqueId(),task);}
      
        @EventHandler
        public void onQuit(final PlayerQuitEvent event) {
            Player thePlayer = event.getPlayer();
            if(!thePlayer.isOnline()) {
                this.stopRepeater = false;
                getLogger().info(String.valueOf(event.getPlayer().getName()) + " has left the game");
                BukkitTask task = tasks.remove(thePlayer.getUniqueId());
                if(task != null) {
                   task.cancel();
                }
            }
        }
    
        public void logToFile(final Player currentPlayer, final Location playerCurrentLocation) {
            try {
                String content = String.valueOf(new SimpleDateFormat("dd-MM-yyyy HH:mm:ss").format(new Date())) + " CurrentLocation(x,y,z): " + playerCurrentLocation.getBlockX() + " " + playerCurrentLocation.getBlockY() + " " + playerCurrentLocation.getBlockZ() + "\n";
                final File file = new File(dataFolder, currentPlayer.getName() + ".log");
                if (!file.exists()) {
                    file.createNewFile();
                }
                Files.write(file.toPath(),content.getBytes(StandardCharsets.UTF_8),StandardOpenOption.APPEND);
            } catch (Exception e) {
                e.printStackTrace();
            }
         }
    }
     

    Attached Files:

  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    caledonian26

    @timtower you mean the 'player.log' file? This did not show any such errors... :(
     
  4. Offline

    timtower Administrator Administrator Moderator

    No, the latest.log
     
  5. Offline

    caledonian26

    This is the output of the 'latest.log' file. It seems to be printing the UUID (hash map ID) of the player and their coordinates at the original starting point - but not throughout the game (which is what I want) :)
     

    Attached Files:

  6. Offline

    timtower Administrator Administrator Moderator

    Why are we talking about logging the players when the problem was a folder not being created?
     
  7. Offline

    caledonian26

    Sorry! Am I right in putting the '.jar' file into the 'plugins' folder as in my screenshot below? (The .jar file was created from running 'mvn clean package' in the terminal'?
     

    Attached Files:

  8. Offline

    timtower Administrator Administrator Moderator

    It runs right? So how would that part be the issue?
     
  9. Offline

    caledonian26

    Yes, it runs, but there is no file called 'player.log' being produced, which the code should execute. No?

    Also, which folder is the dataFolder part of the code referring to on my server?
     
  10. Offline

    timtower Administrator Administrator Moderator

    plugins/yourpluginname

    Then look at the full server log, not just the last part.
    Post your full server log using https://pastebin.com
     
  11. Offline

    caledonian26

    My plugin name is 'newestplugin'.

    I have a folder called 'plugins'.

    However, I do not have a folder that is called 'newestplugin' within my 'plugins' folder.

    This is what I think I am missing!

    Should this be created by the code or do I need to manually create the 'newestplugin' (yourpluginname) folder within the 'plugins' folder?

    Regarding 'pastebin' - do I clone the output and post it here?
     
  12. Offline

    timtower Administrator Administrator Moderator

    @caledonian26 No, you don't make the folder yourself.
    And you clone the log, put it in pastebin, hit save, post link here.
     
  13. Offline

    caledonian26

    Like this? :)
    Code:
    [17:19:06] [ServerMain/INFO]: Building unoptimized datafixer
    [17:19:10] [ServerMain/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
    [17:19:15] [ServerMain/INFO]: Loaded 7 recipes
    [17:19:19] [Server thread/INFO]: Starting minecraft server version 1.19.2
    [17:19:19] [Server thread/INFO]: Loading properties
    [17:19:20] [Server thread/INFO]: This server is running Paper version git-Paper-307 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: 476ef25)
    [17:19:20] [Server thread/INFO]: Server Ping Player Sample Count: 12
    [17:19:20] [Server thread/INFO]: Using 4 threads for Netty based IO
    [17:19:21] [Server thread/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I/O threads, 3 worker threads, and gen parallelism of 3 threads
    [17:19:21] [Server thread/INFO]: Default game type: CREATIVE
    [17:19:21] [Server thread/INFO]: Generating keypair
    [17:19:22] [Server thread/INFO]: Starting Minecraft server on 0.0.0.0:25577
    [17:19:22] [Server thread/INFO]: Using epoll channel type
    [17:19:22] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity.
    [17:19:22] [Server thread/INFO]: Paper: Using OpenSSL 1.1.x (Linux x86_64) cipher from Velocity.
    [17:19:22] [Server thread/ERROR]: Could not load 'plugins/newestplugin-0.0.1-SNAPSHOT.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:178) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:155) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.loadPlugins(CraftServer.java:423) ~[paper-1.19.2.jar:git-Paper-307]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:278) ~[paper-1.19.2.jar:git-Paper-307]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1100) ~[paper-1.19.2.jar:git-Paper-307]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-307]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
    Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
        ... 7 more
    [17:19:23] [Server thread/INFO]: [dynmap] Loading dynmap v3.4-828
    [17:19:23] [Server thread/INFO]: [dynmap] version=git-Paper-307 (MC: 1.19.2)
    [17:19:23] [Server thread/INFO]: [dynmap] Mod Support API available
    [17:19:23] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [17:19:23] [Server thread/INFO]: Preparing level "EmrePHDproject"
    [17:19:23] [Server thread/INFO]: -------- World Settings For [EmrePHDproject] --------
    [17:19:23] [Server thread/INFO]: Item Merge Radius: 2.5
    [17:19:23] [Server thread/INFO]: Item Despawn Rate: 6000
    [17:19:23] [Server thread/INFO]: View Distance: 32
    [17:19:23] [Server thread/INFO]: Simulation Distance: 10
    [17:19:23] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [17:19:23] [Server thread/INFO]: Arrow Despawn Rate: 1200 Trident Respawn Rate:1200
    [17:19:23] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [17:19:23] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [17:19:23] [Server thread/INFO]: Mob Spawn Range: 6
    [17:19:23] [Server thread/INFO]: Experience Merge Radius: 3.0
    [17:19:23] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Cane Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Melon Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Beetroot Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Carrot Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Potato Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Vine Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Cocoa Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Bamboo Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: SweetBerry Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Kelp Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: TwistingVines Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: WeepingVines Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: CaveVines Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: GlowBerry Growth Modifier: 100%
    [17:19:23] [Server thread/INFO]: Entity Activation Range: An 32 / Mo 32 / Ra 48 / Mi 16 / Tiv true / Isa false
    [17:19:23] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [17:19:23] [Server thread/INFO]: Hopper Transfer: 8 Hopper Check: 1 Hopper Amount: 1 Hopper Can Load Chunks: false
    [17:19:23] [Server thread/INFO]: Custom Map Seeds:  Village: 10387312 Desert: 14357617 Igloo: 14357618 Jungle: 14357619 Swamp: 14357620 Monument: 10387313 Ocean: 14357621 Shipwreck: 165745295 End City: 10387313 Slime: 987234911 Nether: 30084232 Mansion: 10387319 Fossil: 14357921 Portal: 34222645
    [17:19:23] [Server thread/INFO]: Max TNT Explosions: 100
    [17:19:23] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [17:19:24] [Server thread/INFO]: -------- World Settings For [EmrePHDproject_nether] --------
    [17:19:24] [Server thread/INFO]: Item Merge Radius: 2.5
    [17:19:24] [Server thread/INFO]: Item Despawn Rate: 6000
    [17:19:24] [Server thread/INFO]: View Distance: 32
    [17:19:24] [Server thread/INFO]: Simulation Distance: 10
    [17:19:24] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [17:19:24] [Server thread/INFO]: Arrow Despawn Rate: 1200 Trident Respawn Rate:1200
    [17:19:24] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [17:19:24] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [17:19:24] [Server thread/INFO]: Mob Spawn Range: 6
    [17:19:24] [Server thread/INFO]: Experience Merge Radius: 3.0
    [17:19:24] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Cane Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Melon Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Beetroot Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Carrot Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Potato Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Vine Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Cocoa Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Bamboo Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: SweetBerry Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Kelp Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: TwistingVines Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: WeepingVines Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: CaveVines Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: GlowBerry Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Entity Activation Range: An 32 / Mo 32 / Ra 48 / Mi 16 / Tiv true / Isa false
    [17:19:24] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [17:19:24] [Server thread/INFO]: Hopper Transfer: 8 Hopper Check: 1 Hopper Amount: 1 Hopper Can Load Chunks: false
    [17:19:24] [Server thread/INFO]: Custom Map Seeds:  Village: 10387312 Desert: 14357617 Igloo: 14357618 Jungle: 14357619 Swamp: 14357620 Monument: 10387313 Ocean: 14357621 Shipwreck: 165745295 End City: 10387313 Slime: 987234911 Nether: 30084232 Mansion: 10387319 Fossil: 14357921 Portal: 34222645
    [17:19:24] [Server thread/INFO]: Max TNT Explosions: 100
    [17:19:24] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [17:19:24] [Server thread/INFO]: -------- World Settings For [EmrePHDproject_the_end] --------
    [17:19:24] [Server thread/INFO]: Item Merge Radius: 2.5
    [17:19:24] [Server thread/INFO]: Item Despawn Rate: 6000
    [17:19:24] [Server thread/INFO]: View Distance: 32
    [17:19:24] [Server thread/INFO]: Simulation Distance: 10
    [17:19:24] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [17:19:24] [Server thread/INFO]: Arrow Despawn Rate: 1200 Trident Respawn Rate:1200
    [17:19:24] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [17:19:24] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [17:19:24] [Server thread/INFO]: Mob Spawn Range: 6
    [17:19:24] [Server thread/INFO]: Experience Merge Radius: 3.0
    [17:19:24] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Cane Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Melon Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Beetroot Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Carrot Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Potato Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Vine Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Cocoa Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Bamboo Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: SweetBerry Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Kelp Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: TwistingVines Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: WeepingVines Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: CaveVines Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: GlowBerry Growth Modifier: 100%
    [17:19:24] [Server thread/INFO]: Entity Activation Range: An 32 / Mo 32 / Ra 48 / Mi 16 / Tiv true / Isa false
    [17:19:24] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [17:19:24] [Server thread/INFO]: Hopper Transfer: 8 Hopper Check: 1 Hopper Amount: 1 Hopper Can Load Chunks: false
    [17:19:24] [Server thread/INFO]: Custom Map Seeds:  Village: 10387312 Desert: 14357617 Igloo: 14357618 Jungle: 14357619 Swamp: 14357620 Monument: 10387313 Ocean: 14357621 Shipwreck: 165745295 End City: 10387313 Slime: 987234911 Nether: 30084232 Mansion: 10387319 Fossil: 14357921 Portal: 34222645
    [17:19:24] [Server thread/INFO]: Max TNT Explosions: 100
    [17:19:24] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [17:19:24] [Server thread/INFO]: Preparing start region for dimension minecraft:eek:verworld
    [17:19:24] [Server thread/INFO]: Time elapsed: 481 ms
    [17:19:24] [Server thread/INFO]: Preparing start region for dimension minecraft:the_nether
    [17:19:25] [Server thread/INFO]: Time elapsed: 157 ms
    [17:19:25] [Server thread/INFO]: Preparing start region for dimension minecraft:the_end
    [17:19:25] [Server thread/INFO]: Time elapsed: 192 ms
    [17:19:25] [Server thread/INFO]: [dynmap] Enabling dynmap v3.4-828
    [17:19:26] [Server thread/INFO]: [dynmap] Added 20 custom biome mappings
    [17:19:26] [Server thread/INFO]: [dynmap] Using Bukkit Permissions (superperms) for access control
    [17:19:26] [Server thread/INFO]: [dynmap] Web interface permissions only available for online users
    [17:19:28] [Server thread/INFO]: [dynmap] Mod Support processing completed
    [17:19:36] [Server thread/INFO]: [dynmap] Loaded 27 shaders.
    [17:19:36] [Server thread/INFO]: [dynmap] Loaded 83 perspectives.
    [17:19:36] [Server thread/INFO]: [dynmap] Loaded 22 lightings.
    [17:19:36] [Server thread/INFO]: [dynmap] Starting enter/exit processing
    [17:19:36] [Dynmap Render Thread/INFO]: [dynmap] Finish marker initialization
    [17:19:37] [Server thread/INFO]: [dynmap] Web server started on address 0.0.0.0:25578
    [17:19:37] [Server thread/INFO]: [dynmap] version 3.4-828 is enabled - core version 3.4-828
    [17:19:37] [Server thread/INFO]: [dynmap] For support, visit our Discord at https://discord.gg/s3rd5qn
    [17:19:37] [Server thread/INFO]: [dynmap] For news, visit https://reddit.com/r/Dynmap or follow https://twitter.com/Dynmap
    [17:19:37] [Server thread/INFO]: [dynmap] To report or track bugs, visit https://github.com/webbukkit/dynmap/issues
    [17:19:37] [Server thread/INFO]: [dynmap] If you'd like to donate, please visit https://www.patreon.com/dynmap or https://ko-fi.com/michaelprimm
    [17:19:37] [Server thread/INFO]: [dynmap] Loaded 3 maps of world 'EmrePHDproject'.
    [17:19:37] [Server thread/INFO]: [dynmap] Loaded 5 pending tile renders for world 'EmrePHDproject'
    [17:19:37] [Server thread/INFO]: [dynmap] Loaded 2 maps of world 'EmrePHDproject_nether'.
    [17:19:37] [Server thread/INFO]: [dynmap] Loaded 2 maps of world 'EmrePHDproject_the_end'.
    [17:19:37] [Server thread/INFO]: [dynmap] Enabled
    [17:19:37] [Server thread/INFO]: Running delayed init tasks
    [17:19:37] [Server thread/INFO]: Done (17.652s)! For help, type "help"
    [17:19:37] [Server thread/INFO]: Timings Reset
    [17:19:41] [Dynmap Render Thread/INFO]: [dynmap] Loading default resource pack
    [17:19:44] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 5052ms or 101 ticks behind
    [17:20:22] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:20:57] [User Authenticator #0/INFO]: UUID of player caledonian26 is 461c8b57-9038-485f-8c7e-70432e5fac61
    [17:20:57] [Server thread/INFO]: caledonian26 joined the game
    [17:20:57] [Server thread/INFO]: caledonian26[/144.82.8.35:61048] logged in with entity id 163 at ([EmrePHDproject]70.00348483218188, -49.0, -0.5130059773758857)
    [17:21:07] [Server thread/INFO]: There are 1 of a max of 80 players online: caledonian26
    [17:21:53] [Server thread/INFO]: There are 1 of a max of 80 players online: caledonian26
    [17:22:01] [Server thread/INFO]: caledonian26 lost connection: Disconnected
    [17:22:02] [Server thread/INFO]: caledonian26 left the game
    [17:22:38] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:23:23] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:24:08] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:24:53] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:25:38] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:26:24] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:27:09] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:27:54] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:28:39] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:28:49] [Server thread/INFO]: Saving is already turned on
    [17:28:49] [Server thread/INFO]: Saving the game (this may take a moment!)
    [17:28:49] [Server thread/INFO]: Saved the game
    [17:29:24] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:30:09] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:30:55] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:31:40] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:32:25] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:33:10] [Server thread/INFO]: There are 0 of a max of 80 players online:
    [17:33:55] [Server thread/INFO]: There are 0 of a max of 80 players online:
     
    Last edited by a moderator: Dec 7, 2022
  14. Offline

    timtower Administrator Administrator Moderator

    @caledonian26 I told you to put it in pastebin!
    Can you explain why it is so hard to follow instructions? Happened multiple times already.
    Code:
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:178) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:155) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_19_R1.CraftServer.loadPlugins(CraftServer.java:423) ~[paper-1.19.2.jar:git-Paper-307]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:278) ~[paper-1.19.2.jar:git-Paper-307]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1100) ~[paper-1.19.2.jar:git-Paper-307]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-307]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
    Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
    ... 7 more
     
  15. Offline

    caledonian26

    What do you mean? That's what I did.

    This is what my plugin.yml file looks like.

    Does that look right to you?

    Code:
    name:newestplugin
    main:newestfile.here.newestplugin.Main
    version:0.0.1-SNAPSHOT
    
     
    Last edited: Dec 7, 2022
  16. Offline

    timtower Administrator Administrator Moderator

    You were supposed to put a pastebin link here, not the content of the log.
    And the plugin.yml is not in the jar, does not matter them what it looks like
     
  17. Offline

    caledonian26

    Oh I'm so sorry for the misunderstanding!

    I was asking about the plugin.yml as I wanted to make sure that the content was right (in case that was what was causing the problem) :)

    Just to clarify, could I check that the following look right to you?

    plugin.yml file

    Code:
    name:newestplugin
    main:newestfile.here.newestplugin.Main
    version:0.0.1-SNAPSHOT
    api-version: 1.19
    
    pom.xml file

    Code:
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>newestfile.here</groupId>
      <artifactId>newestplugin</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-compiler-plugin</artifactId>
                  <version>3.10.1</version>
                  <configuration>
                      <release>17</release>
                  </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
    </build>
       <repositories>
          <repository>
              <id>papermc-repo</id>
              <url>https://papermc.io/repo/repository/maven-public/</url>
          </repository>
       </repositories>
        <dependencies>
          <dependency>
              <groupId>io.papermc.paper</groupId>
              <artifactId>paper-api</artifactId>
              <version>1.19.2-R0.1-SNAPSHOT</version>
              <scope>provided</scope>
          </dependency>
       </dependencies>
    </project>
     
    Last edited: Dec 8, 2022
  18. Offline

    timtower Administrator Administrator Moderator

    Then the error would have said so.

    And I don't know how to read pom files, I am oldschool with my plugins, so can't help with that.
     
  19. Offline

    caledonian26

    In the message you posted above:

    Code:
    Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
    ... 7 more
    So that means that when I ran 'mvn clean package' in the terminal to produce the '.jar' file, the 'plugin.yml' file was not included in this .jar file even though it should have been?
     
  20. Offline

    timtower Administrator Administrator Moderator

    @caledonian26 Like I said: I don't know how maven works, I am oldschool with my plugin making and exporting.
    I don't use maven.
     
  21. Offline

    caledonian26

    Ok thanks so much for your support! :)

    Could you confirm where this error message came from? (how did you view the output of my code?)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Dec 8, 2022
  22. Offline

    timtower Administrator Administrator Moderator

    Server gives the issue. It is in your logs. You read the logs to see the issue.
     
  23. Offline

    caledonian26

    Thanks so much for the helping hand!
     
Thread Status:
Not open for further replies.

Share This Page