A configurable item that serves as a physical replacement for the /spawn command. In my survival world, I felt that the /spawn command was too easy. But my players really wanted to be able to return to spawn easily. So I made this plugin as a compromise. Now, players need to buy SpawnStars from shops before venturing out into the wilderness if they want to be able to teleport back to the world spawn. Also, players would sometimes get stuck in the nether, so I made a configurable option to allow a SpawnStar to return the player to the overworld spawn from the nether or end world.
Features
A fully configurable item that returns a player to spawn when used. Default item is a netherstar, but can be changed to any item.
Customizable display name and lore.
Option to teleport back to overworld from nether or the end.
Configurable cool down period.
Configurable warm up period, with optional particle effects during warm up.
Individually configurable options to cancel teleport during warmup on damage, movement, or block interaction.
Configurable option to remove item from inventory on use, after successful teleport, or never.
Configurable option to prevent using SpawnStar items in crafting recipes.
Configurable option to require shift-click to use.
Uses MultiVerse world aliases in messages, if installed
Uses MultiVerse world spawn location, if installed. (So players will be looking in the right direction on respawn.)
Configurable per message repeat delay (message cooldown) where appropriate.
Customizable language support.
Commands
/spawnstar reload
reloads the configuration without needing to restart the server.
/spawnstar status
displays configuration settings.
/spawnstar give <playername> [quantity]
allows admins or others with permission to give SpawnStars directly to players.
Permissions
Permission
Description
Default
spawnstar.use
gives a player the ability to use a SpawnStar.
true
spawnstar.admin
gives a player access to the following admin commands:
op
spawnstar.give
allows players to give SpawnStar items to other players.
A new version (v1.13.3) has been uploaded. This version restores the option to send a player to a normal world spawn location when a SpawnStar is used in the nether or end.
The logic behind this function is to try and find a matching a world name minus the suffix _nether or _the_end. If no matching world name is found, but there is only one normal world, the player will be sent to that world's spawn location if from-nether or from-end is configured true. If more than one normal world exists and a matching name was not found, they will be sent to the world spawn of the nether or end world they are in when the SpawnStar is used.
There have been no changes to any configuration or language files for this version.
I have tried it both false and true but when I teleport from the nether it takes u to below the map and just kills u in the nether. How can i fix this because I can't find a way to manually change the spawn location of the nether
It appears I inadvertently removed the code that sends a player to the overworld from the nether or end if configured. I'll add that back in to the next release. Thanks for the bug report!
A new version (v1.13.2) has been uploaded. This is a maintenance release that fixes a bug that prevents the plugin from loading when a user provided language file is used. The embedded english language resource file will now be used as a fallback when a message can not be found in a user supplied language file.
No changes have been made to any configuration files in this version.
A new version (v1.13.1) has been uploaded and will be available pending approval. This is a maintenance release with minor bug fixes and updates to libraries. The language files have additions, so please backup and remove these files to allow the plugin to install new versions.
A new version (v1.13.0) has been uploaded. This is primarily an update for 1.13.x compatibility. There are no new features at this time.
Note that fields names in the config.yml, sounds.yml and language/*.yml files have changed. Please remove these files and restart your server to allow the plugin to install the new versions.
public void reloadConfig() {
fileConfiguration = YamlConfiguration.loadConfiguration(configFile);
// Look for defaults in the jar
InputStream defConfigStream = plugin.getResource(fileName);
if (defConfigStream != null) {
@SuppressWarnings("deprecation")
YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream);
fileConfiguration.setDefaults(defConfig);
}
That method was probably removed in this version, since it's been deprecated for a while now. If I get some free time, I may try and patch this myself.
[12:03:28 ERROR]: Error occurred while enabling SpawnStar v1.6 (Is it up to date?)
java.lang.NoSuchMethodError: org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(Ljava/io/InputStream;)Lorg/bukkit/configuration/file/YamlConfiguration;
at com.winterhaven_mc.spawnstar.ConfigAccessor.reloadConfig(ConfigAccessor.java:59) ~[?:?]
at com.winterhaven_mc.spawnstar.ConfigAccessor.getConfig(ConfigAccessor.java:66) ~[?:?]
at com.winterhaven_mc.spawnstar.MessageManager.getItemName(MessageManager.java:252) ~[?:?]
at com.winterhaven_mc.spawnstar.SpawnStarUtilities.createItem(SpawnStarUtilities.java:57) ~[?:?]
at com.winterhaven_mc.spawnstar.SpawnStarMain.onEnable(SpawnStarMain.java:56) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.12.jar:git-Paper-1143]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:316) [patched_1.12.jar:git-Paper-1143]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:404) [patched_1.12.jar:git-Paper-1143]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:379) [patched_1.12.jar:git-Paper-1143]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:329) [patched_1.12.jar:git-Paper-1143]
at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:441) [patched_1.12.jar:git-Paper-1143]
at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:402) [patched_1.12.jar:git-Paper-1143]
at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:340) [patched_1.12.jar:git-Paper-1143]
at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:290) [patched_1.12.jar:git-Paper-1143]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:615) [patched_1.12.jar:git-Paper-1143]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
I checked in advance, and it doesn't look like there's any difference between how that method is used in Spigot or Paper, so I don't think the issue is restricted specifically to Paper.
The latest version of SpawnStar has an issue that manifests itself on Windows servers only. I am working on a fix and will upload a new version once it is confirmed to solve the problem.
The latest versions were not affected by this bug.
Two new releases. Version 1.5.1 is for 1.8 and older versions of bukkit/spigot, and will likely be the last release for older servers. Version 1.6 is for 1.9 and all newer server versions going forward.
That's not a bad idea at all. It's something I might take up at some point, but no promises.
Edit: One possible way to accomplish this would be to integrate with another plugin's warps, like essentials. The item lore could contain the warp name, so players know where it will take them, and so does the plugin. Although to work with the widest array of servers, it would probably be better to have its own warp implementation, rather than depend on any particular other plugin.
Just tossing that out there in case somebody else feels like tackling it.
This may have been suggested already, and may actually need to be a different plugin but I will love you forever if you do this: Have this same thing, but have it so you can set an exact X Y Z coordinate, and have more than one type of teleport, so one star would take you to this location, and a different one would take you to another. I have been looking for a plugin like this for a long time and this is the closest one I've seen.
A new version (1.5) has been uploaded. Many configuration settings and messages have had their identifiers changed, so pay close attention when copying settings from your old config file.
I apologize for the inconvenience, but the setting names were inconsistent in their naming conventions and in some cases ambiguous. For example, 'allow-crafting' could be taken to mean that spawns star can be crafted, when in fact it controlled whether they could be used as a crafting ingredient, so I changed it to 'allow-in-recipes'. Other changes were made to follow a stricter naming convention, so future versions will remain consistent.
Many of the message id's were also changed, for the same reasons. If you made customizations to the language files, make sure that you copy your custom messages back into the proper places.
Sigh. Things are never simple, are they? I guess I'll have to rethink the logic that goes into the on-success mode.
I'm thinking something like this would work: at time of teleport, scan their inventory for a stack of spawn star items, and remove one if found, or cancel the teleport if none are found. That way, they can't remove it from their inventory during warm-up to prevent losing it. And that will take care of the inadvertent removal of non-spawnstar items.
Edit: I'm going to still have them cool down, as a punishment for trying to cheat. }:-)
Found an easy exploit when spawnstar is configured to be consumed on-success - simply switch the spawnstar's inventory location just switch what you're actively holding in your hotbar, and the spawnstar will not be consumed (and if you switch to something you are holding, that item will be removed).
All Most message strings can be changed, and each message can be disabled individually in the language files. There is a list of variables you can use for substitutions in the language files. You can even create a new language file, and point to it in the config file.
Update: The next version will have all message strings in the custom messages file. I've also added a message cooldown, so multiple messages won't fire when an item is used. I rewrote the message handling code, as there were some problems with some messages being sent when commands were issued from the console. I'm currently testing the new code, and will upload the new version when I am satisfied with it.
Yes, that's entirely possible. Although, I personally don't really see the point of cancelling, if they can just click again, but that's just me. I will make that feature configurable so it will be server admin's choice.
- Is it possible to teleport to bed?
- Is it possible to make it craftable with customisable craft recipe?
In reply to Maelep:
See HomeStar plugin for ability to teleport to player bed spawn using an item.
The plugin uses the player teleport method of the bukkit api; there is no ability to substitute a custom command at this time.
Hello
It is not possible to set another command than the "spawn" one ?
I didn't find any plugin/mod with such feature "item command".
A new version (v1.13.3) has been uploaded. This version restores the option to send a player to a normal world spawn location when a SpawnStar is used in the nether or end.
The logic behind this function is to try and find a matching a world name minus the suffix _nether or _the_end. If no matching world name is found, but there is only one normal world, the player will be sent to that world's spawn location if from-nether or from-end is configured true. If more than one normal world exists and a matching name was not found, they will be sent to the world spawn of the nether or end world they are in when the SpawnStar is used.
There have been no changes to any configuration or language files for this version.
I have tried it both false and true but when I teleport from the nether it takes u to below the map and just kills u in the nether. How can i fix this because I can't find a way to manually change the spawn location of the nether
In reply to Forge_User_91464410:
A new version (v1.13.2) has been uploaded. This is a maintenance release that fixes a bug that prevents the plugin from loading when a user provided language file is used. The embedded english language resource file will now be used as a fallback when a message can not be found in a user supplied language file.
No changes have been made to any configuration files in this version.
A new version (v1.13.1) has been uploaded and will be available pending approval. This is a maintenance release with minor bug fixes and updates to libraries. The language files have additions, so please backup and remove these files to allow the plugin to install new versions.
A new version (v1.13.0) has been uploaded. This is primarily an update for 1.13.x compatibility. There are no new features at this time.
Note that fields names in the config.yml, sounds.yml and language/*.yml files have changed. Please remove these files and restart your server to allow the plugin to install the new versions.
Looks like this is the culprit:
That method was probably removed in this version, since it's been deprecated for a while now. If I get some free time, I may try and patch this myself.
In reply to hoorigan:
Getting an error that prevents startup on 1.12:
I checked in advance, and it doesn't look like there's any difference between how that method is used in Spigot or Paper, so I don't think the issue is restricted specifically to Paper.
The latest version of SpawnStar has an issue that manifests itself on Windows servers only. I am working on a fix and will upload a new version once it is confirmed to solve the problem.The latest versions were not affected by this bug.
Two new releases. Version 1.5.1 is for 1.8 and older versions of bukkit/spigot, and will likely be the last release for older servers. Version 1.6 is for 1.9 and all newer server versions going forward.
@keeganjohn
That's not a bad idea at all. It's something I might take up at some point, but no promises.
Edit: One possible way to accomplish this would be to integrate with another plugin's warps, like essentials. The item lore could contain the warp name, so players know where it will take them, and so does the plugin. Although to work with the widest array of servers, it would probably be better to have its own warp implementation, rather than depend on any particular other plugin.
Just tossing that out there in case somebody else feels like tackling it.
This may have been suggested already, and may actually need to be a different plugin but I will love you forever if you do this: Have this same thing, but have it so you can set an exact X Y Z coordinate, and have more than one type of teleport, so one star would take you to this location, and a different one would take you to another. I have been looking for a plugin like this for a long time and this is the closest one I've seen.
A new version (1.5) has been uploaded. Many configuration settings and messages have had their identifiers changed, so pay close attention when copying settings from your old config file.
I apologize for the inconvenience, but the setting names were inconsistent in their naming conventions and in some cases ambiguous. For example, 'allow-crafting' could be taken to mean that spawns star can be crafted, when in fact it controlled whether they could be used as a crafting ingredient, so I changed it to 'allow-in-recipes'. Other changes were made to follow a stricter naming convention, so future versions will remain consistent.
Many of the message id's were also changed, for the same reasons. If you made customizations to the language files, make sure that you copy your custom messages back into the proper places.
@The_PC_Tech_Guy
Sigh. Things are never simple, are they? I guess I'll have to rethink the logic that goes into the on-success mode.
I'm thinking something like this would work: at time of teleport, scan their inventory for a stack of spawn star items, and remove one if found, or cancel the teleport if none are found. That way, they can't remove it from their inventory during warm-up to prevent losing it. And that will take care of the inadvertent removal of non-spawnstar items.
Edit: I'm going to still have them cool down, as a punishment for trying to cheat. }:-)
@timsavage
Found an easy exploit when spawnstar is configured to be consumed on-success -
simply switch the spawnstar's inventory locationjust switch what you're actively holding in your hotbar, and the spawnstar will not be consumed (and if you switch to something you are holding, that item will be removed).@The_PC_Tech_Guy
AllMost message strings can be changed, and each message can be disabled individually in the language files. There is a list of variables you can use for substitutions in the language files. You can even create a new language file, and point to it in the config file.Update: The next version will have all message strings in the custom messages file. I've also added a message cooldown, so multiple messages won't fire when an item is used. I rewrote the message handling code, as there were some problems with some messages being sent when commands were issued from the console. I'm currently testing the new code, and will upload the new version when I am satisfied with it.
@phantom147
Yes, that's entirely possible. Although, I personally don't really see the point of cancelling, if they can just click again, but that's just me. I will make that feature configurable so it will be server admin's choice.