#help-archived
1 messages · Page 23 of 1
Registry.ENTITY_TYPE.get(new NamespacedKey(valueFromConfig))
Yes, that constructor is deprecated but you can ignore that one
Everything is deprecated.
Actually, you should use NamespacedKey.minecraft()
^
In this case there are no plugin-injected IDs so the minecraft method is fine
i am italian i really do not understand this english i don't understand what i have to do
Registry.ENTITY_TYPE.get(new NamespacedKey(valueFromConfig))
Registry.ENTITY_TYPE.get(NamespacedKey.minecraft(valueFromConfig))
That will return an EntityType for you
Math
It’s a sum of all the velocities every tick
That will return an EntityType for you
@subtle blade i still don't understand where to place that piece of code
Right now you have EntityType.fromName(tipo)
public void onRun(PlayerMoveEvent event) {
Player player = event.getPlayer();
World world = player.getWorld();
Location spawnLoc = player.getLocation().add(0,2,0);
String tipo = plugin.getConfig().getString("mob");
if(player.isSprinting()) {
Entity mob = world.spawnEntity(spawnLoc, Registry.ENTITY_TYPE.get(NamespacedKey.minecraft(tipo
)));
}
}
Who cares about null checking... :)
You should 
lmao
Nah ;]
also you realise this will spawn a mob every tick for every sprinting player?
Yea that is a very terrifying method lol
also you realise this will spawn a mob every tick for every sprinting player?
@silk bane is what i want to do
is it really?
i made a cycle for before and it crashed my server
hmm ok
I mean yea, this will likely crash it as well. lol
i just want to troll my server
Best way to do that is spawn Integer.MAX_VALUE particles
move event is faster than that lol
It's not. 20/second
well its when is sprinting
I made a packet that would crash ppls games lmaoo
i saw that it spawned 4 in 1 block
It can only be called at the rate Minecraft updates
And I could target who got it
public void onRun(PlayerMoveEvent event) { Player player = event.getPlayer(); World world = player.getWorld(); Location spawnLoc = player.getLocation().add(0,2,0); String tipo = plugin.getConfig().getString("mob"); if(player.isSprinting()) { Entity mob = world.spawnEntity(spawnLoc, Registry.ENTITY_TYPE.get(NamespacedKey.minecraft(tipo ))); } }
@radiant pollen so i should do this right?
get() is nullable. So make a new variable for it and check that it isn't null.
@EventHandler
public void onRun(PlayerMoveEvent event) {
Player player = event.getPlayer();
World world = player.getWorld();
Location spawnLoc = player.getLocation().add(0,2,0);
String tipo = plugin.getConfig().getString("mob");
EntityType type = Registry.ENTITY_TYPE.get(NamespacedKey.minecraft(tipo));
if(player.isSprinting() && type != null) {
world.spawnEntity(spawnLoc, type);
}
}```
^
But really, type should be created once
Fetching every single time that's called is a horrible idea
Hello,
Hi
Forgot to shift+enter, lol
@EventHandler
public void onRun(PlayerMoveEvent event) {
Player player = event.getPlayer();
World world = player.getWorld();
Location spawnLoc = player.getLocation().add(0,2,0);
String tipo = plugin.getConfig().getString("mob");
EntityType type = Registry.ENTITY_TYPE.get(NamespacedKey.minecraft(tipo));
if(player.isSprinting() && type != null) {
world.spawnEntity(spawnLoc, type);
}
}```
@subtle blade thank you very much
So, I don't have 20 posts to post on hiring developers, but I'd like to commission a plugin for a server I play on. Anyone know a place I could go to?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Yeah :/
Make 20 posts :P
Or get someone else to make a thread and have them put your contact info in there
That's what I'll probably do
(((Not recommended)))
@subtle blade thank you very much
@pearl pawn nvm got error in code
@cursive bay Browse through "Offering - Developers" and find a way to contact people who are looking for commissions.
No problem.
@pearl pawn whats the error?
@pearl pawn whats the error?
@frigid ember you see that red flagged ENTITY_TYPE?
Are you importing the right registry
^
^^
Also don’t name your class Eventi 😭
It would be better to add a constructor with the config file rather than use the api method as well
I should have asked which version
If NamedspacedKey is working I’d assume he’s using the correct version?
Registry was only added in 1.14 I think it was
NK was in 1.11
If NamedspacedKey is working I’d assume he’s using the correct version?
@wanton delta i am in 1.8.8 ;_;
Does anyone have any recommendations for reprogramming 1.12 made plugins for the new Spigot API, because right now my code is lighting up with Material enumeration issues because they changed all the item names... Is there an alternative method to going through and changing every material name and trying to find the right one? Also if anyone can answer the question WHY they did this, that would be great. (I understand it made it a little easier to retrieve specific items names, but is it because of Minecraft itself?)
Also don’t name your class Eventi 😭
@wanton delta How should i call it?
It would be better to add a constructor with the config file rather than use the api method as well
@wanton delta you mean this?
@pearl pawn Like maybe PlayerMoveEvent or something of that nature (probably not exactly because you are calling a PlayerMoveEvent class), that way when you go to find the Event you don't have to sift through 30 events all named Eventi Eventii etc.
@pearl pawn Like maybe PlayerMoveEvent or something of that nature (probably not exactly because you are calling a PlayerMoveEvent class), that way when you go to find the Event you don't have to sift through 30 events all named Eventi Eventii etc.
@frigid ember so i should call it just the name of the event?
like onRunEvent?
@pearl pawn I did in my programs a while back, but it can get confusing if you are calling a PlayerMoveEvent and you have class named PlayerMoveEvent. You can easily get those confused especially when calling it elsewhere. So I think the safest thing to do is just name it something where you can easily identify it but without naming exactly as the Event is defined.
oh ok
Can someone tell me why I can't join Survival with spigot 1.9 I have via version and viarewind
Question, does anyone know of an actually up to date tax plugin? Where I would be capable of taxing a property owner with various categories like property size etc? Say on a weekly basis? Ive seen a bunch of plugins for this but they are all dead.
Can someone tell me why I can't join Survival with spigot 1.9 I have via version and viarewind
@frigid ember which version are you using?
1.8.9
viabackwards?
Isn't loading
The plugins it's crashing
Wasn't it that you could either use ViaVersion or ViaBackwards, not both? I don't remember anymore.
No. ViaBackwards requires ViaVersion
Error message?
@radiant pollen Ah gotcha.
Nope no error messages
Only no load and I can't connect to the server
Wait. You said you have ViaRewind?
When you guys are done discussing your issue if I could get some help with mine that would be greatly appreciated.
@frigid ember Does it show up as red in a plugin list, like it didn't load correctly, or is it just not listed at all?
Does it log anything in the console... Does it even TRY to load it?
Nope not loading when I watch the console only loads via version and via rewind
I would re-download and put it on your server and just make sure you did everything correctly.
Also, check your java version.
It's up to date java
@uncut whale The only updated plugin I've seen with taxes is Towny
Can u send me link of viabackward bcs I have viabackward v3.0.0
@radiant pollen Ok. See I'm looking ideally for something that charges tax once every real life week, including offline players, unless they have been offline for more than 7 days. I realize this might be complex, but do you think its doable with towny?
Thanks
Ok. See I'm looking ideally for something that charges tax once every real life week, including offline players, unless they have been offline for more than 7 days. I realize this might be complex, but do you think its doable with towny?
If not doable with towny the best route you can take is on the services forum
@frigid ember https://www.spigotmc.org/resources/viabackwards.27448/download?version=185628
@radiant pollen so hey how could i fix my issue? because im coding in 1.8.8
@pearl pawn Just keep the deprecated version.
Thanks @radiant pollen and @pearl pawn
@pearl pawn You're using 1.8 spigot, which likely won't be updated. So that deprecated code won't ever be removed. afaik anyway.
(thats correct ^)
What is the issue???
He was looking for a replacement for deprecated code. It doesn't matter though, because he's using 1.8.
lol
NK wasn’t added until 1.11 so you definitely have the wrong version
How do I cancel the PlayerChangeWorld event?
@old barn You can use the PlayerTeleportEvent. if to.world != from.world cancel
I'm pretty sure the TeleportEvent is used before the ChangeWorld event. So the ChangeWorld event won't get called if you cancel the teleport.
public void ChangeWorld(PlayerTeleportEvent e)
Player p = e.getplayer;
if(world.getname.equalsignorecase("War") {
e.setCancelled(True)
}
Something like? If you haven't defined the world, but how are you in this case? how do I check if the world that player is going to teleport is called "war"?
Methods inherited from class org.bukkit.event.player.PlayerMoveEvent
getFrom, getTo,
@old barn Yeah, basically. world = e.getTo().getWorld()
Okay, I'll test it, thanks
No problem
i noiced some changes in 1.15.2 spigot with materials
any exemple how to do it ? in 1.15.2
Changes to Material constants were done in 1.13
i see
All constants should match in-game registry IDs now
i.e. 'minecraft:red_wool' is Material.RED_WOOL
Can someone help me out with mysql (it breaks after some time and some plugins do not update info to mysql after few hours)
I'm so used to the old way and i barely know much about Materials now
Is it really worth making a mini games server any more?
can they still grow and are they worth the money you put into them
where can i find exemples for 1.13 material and item and other stuff
@frigid ember Not if you use pre-made minigames that make your server like all the others. My server is basically one custom game and it does alright, so far. It's pretty new and I get new players and they enjoy it.
The problem with making a mini-games server or any pvp-based server is the fact that new players don't stay because there's no one to play against. Haha.
materials are quite a lot simpler
That's probably the only major issue.
@radiant pollen Do normal mini game server work like sg master builders etc
@frigid ember I can't see how they would get players when you used public plugin mini-games that are just copies of mini-games on huge networks.
You have to be unique.
Do good builds not make it better
good building has nothing to do with pvp
what makes your players stay on the server? builds or the actual game?
builds are to make your server appealing so players will be more inclined to join
your games retain players
any staff available?
No
Whatever you need it's likely answerable either here or in #general
i need my username changed on spigot
We grant access to name changes to those who've donated to the project
Do not use Discord™ as a way of contacting Spigot Staff. If you have an issue with something on the Forums please open a report. Staff will not action requests communicated to them elsewhere.
... wtf that's bullshit... i recently came out as trans....
huh
Does that make you somehow entitled to a name change?
Special privileges I'm unaware of?
it kinda does? male name > female name?
what is your current spigot name?
Sync'd with the forums. Zoni
zoni, and i want it to be vitani which is the name i've chosen as a female
i mean i could just make another account but still... i'd lose my $10 plugin and i am kinda poor
It's $10 to change your name.
you know i have $0 a month?
Then you can't change your name.
Sounds like you need a job 
been trying that but i haven't been able to get a job yet, and curently i can't
because the government is in charge
Understandable at the moment. Especially if you're unable to work from home
no i mean the government paid for my education which guarantees a job, since they haven't been able to keep those promises now the government decides what steps to take next
I think one of the main points is spigot cant hand out special requests
then you will have people faking identities to get a name change
That being said, we aren't going to grant special privileges. Exceptions aren't going to be made. The best alternative at least for the time being is to change your gender in your preferences
^
We then also have people saying "BUT THIS PERSON DID IT!"
how much do you have to donate to change your username?
$10
It's $10 to change your name.
@radiant pollen
really... would be the same to just delete my account and recreate it with another username...
@lean knot There is no way to delete your account.
Who Know Any Custom Fishing Plugins For Just 1 Area
once again we are not your google
Hi does anybody here have experience with Hibernate ?
we dont have the knowledge of 1000s of plugins
@wanton delta Bryh on google They never work
@pale plaza What do you mean by "Just 1 Area"
i think he means modify the loot tables for fishing in a defined region
@EventHandler
public void ChangeWorld(PlayerTeleportEvent e) {
Player p = e.getPlayer();
World w = e.getTo().getWorld();
if(w.getName().equalsIgnoreCase("War")) {
for(ItemStack item : p.getInventory().getContents())
{
if(item != null) {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "givekit war " + p.getName());
p.sendMessage("§eWelcome to the war world");
e.setCancelled(false);
}else {
p.sendMessage("§cClean up your inventory");
e.setCancelled(true);
}
}
}
Someone help me? is not working and is sending the message 10 times
How do you set a Player's scoreboard to nothing? I tried player.setScoreboard(null);
@ashen stirrup Create a new scoreboard with nothing in it and set their scoreboard to that.
Might be better to just have one instance of an empty scoreboard and set their scoreboard to that. That way you don't create a new empty scoreboard anytime you need to remove it.
Should save memory I guess.
@old barn you send the message in the for loop
which is iterating over inventory contents
@old barn You're sending the message inside the loop for the inventory. You're sending the message for each item.
You're also cancelling and uncancelled the event inside the loop so it won't work.
Make a loop that checks if their inventory is empty and create a new boolean for it. Then use that to determine if they get the kit and join or it gets cancelled.
@EventHandler public void ChangeWorld(PlayerTeleportEvent e) { Player p = e.getPlayer(); World w = e.getTo().getWorld(); if(w.getName().equalsIgnoreCase("War")) { for(ItemStack item : p.getInventory().getContents()) { if(item != null) { Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "givekit war " + p.getName()); p.sendMessage("§eWelcome to the war world"); e.setCancelled(false); }else { p.sendMessage("§cClean up your inventory"); e.setCancelled(true); } } }Someone help me? is not working and is sending the message 10 times
@old barn This ain't C#
Because you have 10 items in your inventory
lol
before you do anything else think about what youre trying to do
test if the players inventory is empty
there is a better way to do that
@radiant pollen a Region basicly u can only fish and catch in the region what i sellect and i can customise the fish loot
It has good ratings and was updated earlier this month. You're probably doing something wrong.
Check the console for errors when you restart your server.
No Cus i download zip then put in plugins then unzip
That's wrong...
How Then
Plugins are .jars not .zips.
You probably downloaded the source code or something.
this is a rather odd question but what faction plugin should i try to fork ?
Massive Factions
whatever you like imo
@pale plaza Click the download link for the .jar
im basically asking which one is the best
Then To change cost of to buy a faction land go config change cost to 0 or set a price
@radiant pollen But There Is No Jar
Send me a screen of were
That's the download link from the Spigot resource page.
There is, very clearly, a .jar.
is factionsuuid free ?
@pale plaza I don't know. I've never used the plugin before. I just did a Google search for you...
You're gonna have to read the resource page.
There's a wiki link there.
@radiant pollen Well still unkown command when i try the one they put on site
Did you restart the server?
Did it generate config files?
Yeh but tHERE nothing there
Now It Work but say nothing about setting up with regions
I'm having some issues loading plugins into my server recently. When I put the .jar file for the plugin into my plugins folder, it shows the size as being 0KB, and when opening with 7zip, the jar file is completely empty.
List<AbstractUpgrade> upgrades = machine.getUpgrades();
upgrades.forEach(upgrade -> {
System.out.println(upgrade);
upgrade.applyUpgradeModifier(MachineResourceGetProcess.this);
});```
java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast to me.oriharel.machinery.upgrades.AbstractUpgrade
at java.util.ArrayList.forEach(ArrayList.java:1257) ~[?:1.8.0_221]
at me.oriharel.machinery.machine.MachineResourceGetProcess.startProcess(MachineResourceGetProcess.java:38) ~[?:?]
at me.oriharel.machinery.Machinery.lambda$loadMachineData$4(Machinery.java:113) ~[?:?]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:81) ~[spigot-1.15.2.jar:git-Spigot```
Why the hell am I getting this error 😅
upgrades.forEach(upgrade -> { this is line 38
hey boys
probably*
is there a way to edit a vanilla server's mob cap?
I'm trying to run the latest snapshot and there's no spigot for that
i don't think so
however you can always use their own mapping to check where its at :p
do they publish sourcempas for snapshots?
Hey, do any of you guys have any experience with issues regarding the Scoreboard? It seems to me you can't have any formatting, like strikethroughs, underlines etc.. On the very last line of the Scoreboard. Unless... A title message is shown, an actionbar message is shown or the title above an item in your actionbar is shown.
It seems to me that this is a bug with Minecraft itself, but I'm just hoping to see if any of you know of a workaround, that doesn't consist of adding an extra line below the one in question.
@meager lantern use setDisplayName
I'm using NMS code, I'm sending all of the packets myself and the packets that are being sent do contain formatting, so I'm certain that it's something happening on the client side, which is also why the formatting is stripped and shown whenever client side events happen
So what are you changing in the packet
I'm not changing anything, I'm just sending a packet telling the client to show a given name with a given score on the Scoreboard, which works just fine, with the exception of whatever name is located at the bottom of Scoreboard
Ah yes
It seems to me, that the bottom line of the scoreboard is bugged on the client side, but I just want to make sure, that I'm not missing something here
i think the work around is to add an empty line at the bottom
Yeah, that I knew, but it doesn't look too nice
¯_(ツ)_/¯
So is this a known issue?
Could you send an empty ActionBarMessage?
Ah okay
Oh hey, Zax!
Hey!
hmm
I don't think the actionbar messages is shown if it's empty, I've thought about it though
Hey guys!
What is the Material for grown beetroot in 1.12.2?
This could cause issues with other plugins sending actionbar messages, that don't go through my plugin though
@unkempt dock "BEETROOTS" is the block.
As there's no way to check if an actionbar message is currently being shown to a user, unless I decide to intercept packets
Oh, true.
Material.BEETROOT_BLOCK?
Oh you said 1.12.2
@meager lantern this is how a plugin is oging it
Yeah it should be BEETROOT_BLOCK
if (!lines.isEmpty() && lines.get(lines.size() - 1).equals(""))
lines.remove(lines.size() - 1);
board.setSidebar(lines);
Bukkit.getOnlinePlayers().forEach(o -> o.setScoreboard(board.getScoreboard()));```
okay, I will give it a try
lines is an arraylist of the scoreboard lines
i think what it is doing is adding an extra line then removing it?
It seems to me it's removing the last line if it's empty, but that is all being done before it's being sent to the user
So the user still has a Scoreboard with a broken bottom line
It looks like this would have the same issue as any other Scoreboard plugin
People that use TitleManager are able to add an empty line to the bottom of the scoreboard themselves, if they require formatting, though I just wanted to see if there was a workaround
It definitely seems like a client-side bug.
Definitely
I can't find anything that seems like this problem on the bug tracker though.
You sure? Do you know of anywhere I can test it out Mart?
its a plugin im working on updating rn
(i did not create the system, im just updating it)
Right, yeah I saw that LibraryAddict has had his hands on it
To read a yaml how is it? It is that it returns null with this:
File file = new File(plugin.getDataFolder(), "messages.yml");
YamlConfiguration messages = YamlConfiguration.loadConfiguration(file);
registerNewObjective(@NotNull String name, @NotNull String criteria, @NotNull String displayName)
What is meant by criteria?
And does name have to be unique?
Guys, BuildTools has started throwing an error every time I run it:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install (default-install) on project spigot-parent: Failed to install metadata org.spigotmc:spigot-parent:dev-SNAPSHOT/maven-metadata.xml: Could not parse metadata C:\Users\RonaldMcDonald.m2\repository\org\spigotmc\spigot-parent\dev-SNAPSHOT\maven-metadata-local.xml: only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1) -> [Help 1]
I tried deleting maven-metadata-local.xml but it didn't fix it.
If the file exists, it is in the plugin folder
How do I check if the player has armor on?
player.getInventory().getArmorContents()
loop through all, if they are all null he has no armor on
@dusty topaz criteria is the vanilla scoreboard criteria. There’s dummy, player kills, entity kills, etc
Dummy is probably what you want to use so you can increment the score or set it to the value you want
Hello! Can someone please have a quick look at this https://paste.md-5.net/futehekecu.md
I'm having problems starting at line 728 and can't seem to spot the issue.
I'm running 1.15.2 I'm using PlotSquaredV5. Whenever I go into the plot world I'm getting this timeout error. Unsure if it's spigot or plugin related.
Hi, I'm trying to serialize an Object into json with Gson, this object contains a field that is an ItemStack array.
The problem is I'm getting an StackOverflow: null error. Even when using an ItemStackAdapter like this:
private static final class ItemStackAdapter implements JsonSerializer<ItemStack>, JsonDeserializer<ItemStack>{
@Override
public ItemStack deserialize(JsonElement element, Type type, JsonDeserializationContext context)
throws JsonParseException {
@SuppressWarnings("serial")
Map<String, Object> map = context.deserialize(element, new TypeToken<Map<String, Object>>(){}.getType());
return ItemStack.deserialize(map);
}
@Override
public JsonElement serialize(ItemStack itemStack, Type type, JsonSerializationContext context) {
return context.serialize(itemStack.serialize());
}
}
public static final Gson JSON = new GsonBuilder().registerTypeAdapter(ItemStack.class, new ItemStackAdapter()).create();
Is it related to the fact that the field is an array, and this adapter is for a single object ?
On Spigot 1.15.2, usercache.json is located in the --universe (startup parameter) directory. I just did some testing on 1.14.4 and 1.13.2, and usercache.json is located in the Spigot root directory. Can someone point me to a reference for the change, or at least confirm that my observations are correct?
I searched the Mojang and SpigotMC issues forums: no joy.
Guys, BuildTools has started throwing an error every time I run it:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install (default-install) on project spigot-parent: Failed to install metadata org.spigotmc:spigot-parent:dev-SNAPSHOT/maven-metadata.xml: Could not parse metadata C:\Users\RonaldMcDonald.m2\repository\org\spigotmc\spigot-parent\dev-SNAPSHOT\maven-metadata-local.xml: only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1) -> [Help 1]
I tried deleting maven-metadata-local.xml but it didn't fix it.
public Scoreboard getScoreboard() {
Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
Objective objective = board.registerNewObjective(boardName, "dummy", "&6&lSimon Says");
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
Gamescore score = minigame.getGamescore();
for (Playerscore playerscore : score.getAllScores()) {
Score scoreboardEntry = objective.getScore(ChatColor.YELLOW + playerscore.getPlayer().getName());
scoreboardEntry.setScore(playerscore.getScore());
}
return board;
}
@Override
public void run() {
Scoreboard board = gameboard.getScoreboard();
players.forEach(player -> player.setScoreboard(board));
}
}.runTaskTimer(instance,20L,20L).getTaskId();
Anyone got any idea why that doesn't work?
I can't figure it out
Is it possible to have a single hardcore world on a non-hardcore server?
onceAndEternal
Maybe a custom plugin for the world you want to be hardcore?
Check for player in the world and check if they have died once in the world then
if true then put them to spectator mode and changed player's gamemode depending on the world they're in
maybe there is an easier way😅
Yeah I'm using multiverse. Custom plugin definitely sounds like the way I need to go
if(event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction().equals(Action.RIGHT_CLICK_BLOCK) && event.getItem().getType().equals(Material.GOLD_SWORD)) How come this statement evaluates to true if I'm right clicking any block, not just a gold_sword
Two if statements?
yes
nested?
or suuround the actions in another ( )
&& takes precedence over ||
^
yes
You're effectively doing
right click air || (right click block && gold sword)
oh
Thank you Adam Morris
So group the action logic together
But leave && outside
wouldnt if((actionA||actionB)&&goldSword) work?
Yes
That's what I was suggesting
Thank you for your help Stellrow and Adam Morris. Stay safe!
It depends on what you want.
tbh i would just separate them doesnt hurt anything..
Ye, makes it more readable, rather than being a long line lol
U guys got any nice java tutorials? Maybe on yt?
Learning Java or the Spigot API?
java? there are plenty you can choose from
spigot/bukkit? TheSourceCode did a great job going over pretty much everything
tools?
Ye
explain more i ddidnt get what ur asking
Is There a way to make a axe ban people
@pale plaza Essentials power tools.
Thanks
@radiant pollen What prefix idk xd and do i have to install or is it in essentils already
ik but is the power tool built in
@pale plaza Holding an axe, do /pt ban USERNAME
Yes.
/pt ban @p might work? idk.
also idk if essentials /ban supports player selectors so you might need /pt minecraft:ban @p
I wanna know is there a 1.15.2 that can make your name colored in tab?
Essentials?
Yes
That's the plugin?
You don't have Essentials installed already?
I will do it later i am on my phone rn but thx for the help
np
Btw sorry if my english is bad
https://hastebin.com/unesofaruw.cs Anyone know what's going on here?
my servers on 1.11.2 im pretty sure
A few players on my bungeecord server get disconnected with an existing connection was forcibly closed by remote host
and I have done a lot to try to fix this but I can't seem to be able to
it stated happening today
It just stated doing it
Hmmm
and players are only crashing in the lobby server
not in the bedwars
oh nevermind
they crash in bedwars too
so I think it's a bungeecord issue
omg
it was my ping limiter plugin
@EventHandler
public void Comandos(PlayerCommandPreprocessEvent e) {
Player p = e.getPlayer();
World w = p.getWorld();
if(w.getName().equalsIgnoreCase("War2")) {
if(p.hasPermission("blaze.staff")) {
e.setCancelled(false);
}else {
e.setCancelled(true);
p.sendMessage("Error.");
}
}
}
Can unauthorized players type commands anyway? the "Error" message appears, but they can type commands
Yes, but I wanted to block all commands in this world, for example /spawn
players on my server are now getting kicked with read time out null
I am not sure how to fix this
internet issue?
nope
I have been running this server for over a year
and the issues started today
What did you change?
nothing
@old barn You need to use a permissions plugin.
these are my plugins
Why are you using nms for this
because i need to add an identifier to my item
i dont want to check lore and display name
ba dum persistent data container
look up how to use reflection for constructors :/
i only asked this because on 1.8.8 i could use this
what version is this
1.15.2
ba dum persistent data container
what is that
oh my mistake
i had the wrong jar open
that was 1.12.2
@red bolt if you still insist using NBT, use NBTTagString.a
anyone know how I can fix the read time out null error? I followed the bungeecord guide.
Can anyone help me i'm trying to use the Prism Plugin for minehute server ive installed the plugin and loaded the game and i get this : /prism ?
it wont let me paste an image to show.
verify your spigot account
Use !verify <forums username> to get a PM to verify your forums account with Discord.
!verify
Usage: !verify <forums username>
!verify dubln
Could not find your SpigotMC.org account!
I am getting Exception Connection:ReadTimeOutException : null
on my bungeecord server
please can someone help me
@red bolt its NBTTagString.a("String"); depending what version your using
public static ItemStack setTag(ItemStack item, String key, String tag) {
net.minecraft.server.v1_15_R1.ItemStack nmsApple = CraftItemStack.asNMSCopy(item);
NBTTagCompound applecompound = (nmsApple.hasTag()) ? nmsApple.getTag() : new NBTTagCompound();
applecompound.set(key, NBTTagString.a(tag));
nmsApple.setTag(applecompound);
return CraftItemStack.asBukkitCopy(nmsApple);
}
This works in 1.15.2
@pastel condor you did something wrong.
yee i got it
Ok
Are you using maven or gradle?
me ?
but what did I do wrong? @frigid ember
ye
my server has been running smoothley for almost a year
then I start getting these issues
https://www.spigotmc.org/resources/nbt-api.7939/
I would recommend at least looking at this
I use it for all my NBT stuff and saves so much time
idk how to use it on eclipse
do i really need to pull up lmgtfy
its kinda clunky when you learn it and youll wonder why tf anyone would use it
I need help fixing Exception Connection:ReadTimeOutException : null
but it is well worth the hassle
yes'
adding jars to classpath is 🤢
maven dependencies make the whole process easier
you can still use jars as deps with maven but you can also access repo's such as spigot which means every time spigot updates, you automatically are compiling against the newest version if you specify that.
usually jars with apis are already on maven as well
only time ive had to manually add a jar is when the repo was outdated/no longer managed
that sounds cool
btw
do i put nbt tags before setting item meta data ?
like name,lore etc
or the opposite ?
wait can you access nms stuff if you use maven?
yeah but you need to run build tools
to have it in the local maven repository
i think
yeah nms is not in the "remote" maven repo
just run buildtools and add spigot instead of spigot-api as a dependency
Hey, are there any spigot-api builds for 1.16 or the current snapshots?
I can't seem to find where it would be
Really? So there's no way to start updating plugins? 🙂
Guessing the api will be changing a lot with every snapshot if they've even started updating
Can anyone help me i'm trying to use the Prism Plugin for minehute server ive installed the plugin and loaded the game and i get this : /prism ?
probably is telling you to do that command
Hi. Just started messing around with bukkit/spigot tonight. I'm wondering how I can identify a dropped stack of items. I want to store dropped stacks in my database, to keep track of who dropped it for next time someone picks it up. What would the best approach be? Cant really find anything in the bukkit documentation that I see as a unique identifier.
There really isn't anything other than the Entity ID, though the issue with using that is that it changes its ID when its unloaded and loaded back into the world. One way to go about this would be to create a persistent NBT tag with your own unique identifier and link it to the stack
The issue with NBT tags is that there are only third party libraries for this that break upon newer versions of Bukkit/Spigot, unless this has changed over time. (My knowledge could be outdated as I haven't been writing new plugins for a few years now)
i think someone mentioned something like PersistentContainer
That's what I'm thinking too now, after looking a bit more in the documentation. Thanks for all the input.
Yeah changed the lore would probably be the easiest thing approach, you'll just have to remove the identifier again when the player picks it up
I'm working on a custom item and inventory system as well though, but the way it's working is I store all the inventory of the player and the "custom item" as it's own thing and repopulate the player's inventory every time they connect/reconnect
guys when i downlod plugins in my vps server some plugins dosen't work i think from java [apt-get install openjdk-9-jdk]
what verison too downlod plugins 1.8.8 and up
vps
Ubuntu 18.04
And you could easily store the ID, but like he said theres the issue with dropping items and restarting the server when they dont get the same Entity ID
@dusky herald I'll create my own id for each stack instead. That should persist on restarts, right?
I assume that's what PersistentDataHolder means
You could try, or you could also store the dropped items in the database and their coordinates/stack counts etc and reload them back in later after restarts
I mean there could be a ton of methods to actually approach it and resolve the issue.
Some just take more work than others
Hmm why would i get more skillpoints than i typed? public void addSkillPoints(Integer toAdd) {
this.skillPoints+=toAdd;
}
It's for a companion plugin with the usual level system,problem is
it adds the level amount to the skillpoints amount
its probably being called more than once
private void checkLevel() {
if(xp>=xpNeeded) {
addLvl(1);
decreaseXp(xpNeeded);
addSkillPoints(1);
}
}
this is the check
it shouldnt matter?
when is checkLevel called?
just because there's only 1 use doesnt mean its not called twice
eclipse its showing only 2 in the hole class
can you show the code where checkLevel is called?
the method and the check on xp
it doesnt matter if its only once, if its inside an event it may be called twice
public void addXp(Integer xp) {
this.xp+=xp;
checkLevel();
}
when is addXp called
on a blockbreakevent,its not event calling twice
as its not 2 skillpoints
its specifically the lvl amount as skillpoints
have you tried printing something in your event to check if its not being called twice
well time to fire up the local server and go ham
idk if it would even matter
the problem seems to be somewhere in the logic
at experience system
btw having an addXp and removeXp method seems a bit redudant. you could just have setXp(getExp() - something something)
gonna solve it tomorrow,im getting too sleepy
I'm still having trouble loading or making /prism work for minehut server 😦
all i get is this...
That looks like a message warning the command doesnt exist
Is the plugin green in /plugins?
Also shouldnt you add more checks? What if a player gets more XP required for more than 1 level?
Theyll just gain 1 level and lose out on that extra level
Til they gain more xp
@dusky herald not rly.. the check is made whenever they receive xp
If i set it to 1000 everytime it gets checked from adding xp they lvl up
Also i made it this way as you cant get experience only through X..
Yeah i guess i can slap the method again on the levelup one
Like if you require 3000 xp to level from 3-5
And you're level 2 and you get like 5K xp or whatever
They would only level up to 3, and not to 5
In this case were talking about lvl*40 for lvlup..
Becayse you didnt factor in leveling up more times based on the differences
Because you cant get xp that fast
Unless you edit it in that player config file it wont ever happen
I mean it's up to you either way, I just think it's a good idea to handle the differences and iterate on extra levels
I can just call the check method inside herself...
So it loops itself till it finishes
Yes, that's what I mean
Just keep running loops til it runs false
You may never actually make use of it, but you can always plan ahead just incase
True...
Anyone know what the "pluginInstance" is in NamespacedKey?
Not sure how to get that
That looks like a message warning the command doesnt exist
@vernal spruce Yes ill show you a picture one moment.
Is it possible to convert 1.15 byte data into legacy data?
this is what it looks like @vernal spruce
hi this is a fairly silly quesiton but does the primitave char require == or .equals
Because it's a primitive you can't use .equals
==
== is the only option.
Primitives dont have methods.
yea i knew it was silly
i was second guessing because char is similar to String in the fact it has to do with text
A string is just an array of Chars
It's a wrapper class at best
So yeah, they are similar.
interesting
String = char[length of string]
so heres the context
and im not sure if im doing this corectly, there might be an easier way
im trying to make a chatcomponent with color assigned to it
if (prefix.startsWith("§")) {
for (EnumChatFormat value : EnumChatFormat.values()) {
if (value.character == prefix.toLowerCase().charAt(1)) {
prefixComponent.setChatModifier(new ChatModifier().setColor(value));
break;
}
}
}```
this doesnt seem to be producing good results
when i print it to console this is what i get
TextComponent{text='§9', siblings=[], style=Style{hasParent=false, color=§9, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
but the text im getting is white :/
You cant just use ChatColor?
I forget I havent worked with those ChatModifiers in forever
nope
I thought it still uses ChatColor but you had to set the color in the modifier
Hi, I have a issue where Im on Spigot 1.8.8 and I have an alt on 1.15.2 (I have via version) and when Im in adventure mode it takes the item away for a second and then gives it back. But its not really taking it away
Its very weird
does anyone know how to convert this string into blockstate
minecraft:redstone_wall_torch[facing=north,lit=true]?
Does anyone know how to put bots, to test the stamina of my server?
😄
Anyone know of a plugin that properly respawns the dragon without any issues or being clunky and unoptimized? Excluding DragonSlayer and DragonEggDrop.
@lofty elbow look at the methods in Server returning BlockData
The method getTargetBlock(java.util.HashSet<java.lang.Byte>, int) in the type LivingEntity is not applicable for the arguments (HashSet<java.lang.Byte>, int)
I've tried (Set<Material>) null too
Do I need to import java.util?
Why are you using a deprecated method
probably using 1.8
Doing (Set) null should work in theory though
Likely is wrong import
Pretty sure when I've worked with decompiled code it's worked like that
im having an issue where i upload a minecraft world and set its folder name to the level in server properties, changing it from default world. then everything i try to start the server it crashes
So I used Bukkit.getScheduler().runTaskAsynchronously to loop through and update some block states in 1.13 but in 1.14 something changed that you can't access certain items like chests and stuff with inventories asynchronously, what should I use to replace it without lagging the server out lol
Do you not think the crash log would be helpful
@frigid ember that was never safe to do
The documentation is VERY CLEAR that you can’t use most api methods async
I have like a basic understanding of async and sync not the most known on that I just know that theres like a main thread and an off thread and when I used the async it spaced it out, not really sure what to use now instead or what would be optimal
I've used runTask instead to try it out and it ends up crashing the server lol
so I'm not really sure how I can space it out
@frigid ember You'd have to use a synchronous task. If looping through everything you need to crashes the server, maybe just do one at a time in the task and reduce the period rather than looping through all of them.
Just out of curiosity
Could I make an Async method and then put a sync method inside of it?
Like
A runnable that is sync inside of the async
Sure but that doesn’t really help unless you have heavy calculations to do
Like do the extra bs with my async then pass it off to sync
Yeah that's what I mean, just the bad overhead then when those calculations are done then just back to sync
To access whatever I need to change
You'd definitely want to do some testing.
Might just slow it down in the long run, compared to just doing everything in a sync task.
Yeah like I said I'm just curious, it's not something I'm even working on rn
Well, I mean like running database queries
Then passing off the results, etc
Like X player logs in, load their inventories async
Then pass the completed objects then sync them
And use the Bukkit API to implement them to the server basically
u guys know how to use featherboard dd/MM/yyyy placeholder
like i want it to show how many "Days" has already passed since from the reset and if its like reset ago it would be Day 1 and should be displayed "1"
i've tried using - '&4&lFaction <epochconvert from-seconds="2m">d</epochconvert>' i'm kindda noob at this shit someone with High IQ teach me pls 😂
SimpleDateFormatter formatter = new SimpleDateFormatter(“dd/mm/yyyy”);
formatter.format(new Date());
i think, im not sure i did that on mobile
im probs weong someone correct me
might be wrong
Anyone know how to make a post request to the mojang api (https://api.mojang.com/profiles/minecraft) with content?
anyone know how to use skript. like when i do /go it does /warp and 3 other /commands?
hey anyone knows how can i fix disconnect.spam kick?
AlveeYT do you use Viaversion?
whats your server version?
yeah its currently an issue with ViaVersion when you type command or any packet you do you get kicked
so what do i do?
there's really no fix for it atm unless you make your own ViaVersion plug-in
aw
or switch to the latest version 1.15.2 and install ProtocolSupport which will add support to older version
ok thanks for the help
everything i try to slow down the blocks crashes the server lol
all im tryna do is get an arraylist of blockstates
Do spigot supports plotsquared?
Yeah?
@last tapir are there any errors in the console?
what version of spigot are you using
I'm sorry but its like 3am for me right now, so i'm going to bed, just ping me in the morning thanks
How do I catch a command to count how many times it is executed but also let that command go to the plugin that does somethinh with it
they just want to count the amount a command got executed
Is it possible to have a vanilla server backing the bungee server?
ah nvm I see there's VanillaCord
How much lag can be caused from creating a list like:
https://gyazo.com/6b7e7d18f6f399363609c81998e3c7e7
Every time someone runs a command?
Is it worth caching and changing it whenever players log on and off or should i just create a new list?
you don't create a list but an object to store data like that
Just look at ur timings
i just have to create the list to send to the player, or alternatively cache it with the Gang object
See how much impact it has
Then you can still look at timings ..?
But generally speaking i dont think this would cause much issues lmao
I want to make it as optimized as possible
Just check with timings afterwards and maybe you dont need the caching hell afterall
But also not die from all the caching lol
@bronze marten it doesnt even show on the timings lol
i dont think its gonna be a factor at all
But why would you want to show this on every command btw
what's is the best way to update a plugin configuration file's format? (without messing up the comments, self repair and auto upgrade)
So I have an important question! And when I go to your site, I get scam-pop-ups so there I would have won an Iphone or something and that scares me a bit. It is only on your side and every time I look at a plugin!
What site?
How do I test if it is on my PC I already did a virsu scan
Depends what antivirus you got
Only Windowsdefender
It sucks
try the antimalware tool for your browser @frigid ember
Okay thx
though if you are at this point you might as well reinstall windows
that way you can be pretty sure you got everything
https://pastebin.com/cxKsskGg - Anyone has an idea of why I get You picked up null in the EntityPickupItemEvent, but I can output You dropped SOME_UUID in the PlayerDeathEvent?
I mean, I can get it from the PersistentDataContainer after setting it, in the first event, but when I then try to pick up the stack later on, it does not know the value.
Or now that windows is broken, just stop using it.
@naive stratus null check it?
@naive goblet Null checking wouldn't help me here. I expect there to be a value, since I just set it on the items meta data, in another event.
Sure, I can check for null, but then what? 😉
Use EntityPickupItemEvent this event seem to be deprecated and don’t use pastebin
Or maybe inventorypickupitem
@naive goblet Where do you see that EntityPickupItemEvent is deprecated? I'm looking at https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityPickupItemEvent.html
hey who know any spawner plugins cus i have one but it wont work
I cannot for the life of me figure out why I cannot retrieve the data in the pickup event... Modified the code a bit, removed the deprecated parts, but still same result. I can get the value and output it in the onPlayerDeath event, but still not in onEntityPickupItem. It will always output "You picked up unknown items"
- If someone could take a look at it, while I go for lunch, that would be great. Would really appreciate it!
Main: https://pastecode.xyz/view/b6b95042
Score: https://pastecode.xyz/view/479c736b
(Hope this paste provider is ok)
Idk if its more of a Java issue that I am missing. I'm not experienced with Java at all.
Hey im making a plugin so u can bind anytool to ban Who can help me like tell me what to so
why doesnt
OutputStream out = new FileOutputStream(resourceFile)) {
ByteStreams.copy(in, out);
} ``` work on java 8? it wants me to change to java 7?
Wow.
I got a final ConcurrentHashMap that is null
I don't understand
Something like this
and calling getField(uuid) returns an NPE
with UUID not being null
If I replace it with HashMap, there's no NPE anymore
Would need the full code man 🤷♂️
Although I've had WEIRD shit happen before with Java code
the null is the hashmap or the actual values in it
the hashmap is null
getting an NPE on line 41, and line 40 says null
replacing with HashMap -> no NPE
(that error is Caused by NPE on line 41)
Maybe IntelliJ cache problem
Yeah rebuild the project
Hopefully it's not due to the eager initialization of that cache class
As in, it's a weird ass JVM bug
I mean I do understand getting an NPE from a get() with null argument
but why is there any difference between HashMap and concurernthashmap on initialization, this is what I really don't get.
Rebuilding
What
@sick citrus HashMap tolerates null key/values, concurrenthashmap doesn't
I know RobinMC
That makes literally no sense to me
the hashmap itself is null
so it could make sense that get(null) works for one and doesn't for another
that can't be because you are statically inializing it
You're using entry to cycle throufh
so it can never be null
@sick citrus try changing public final to public volatile final ?
wait.... that shouldn't be the case nvm me
He claimed the map reference it's self was null
Wel lit's not anymore
If its null then how is he iterating through and reaching line 40?
after invalidating IntellJ's cache
Ah okay
The first entry iterated properly
it's "reverseIp" that is causing issues
not "reverse"
and both of them were ConcurrentHashMap s
(until I changed it, which is what you saw on the screenshot)
And you did initialize your PlayerCache class right?
How else could I possibly call that method without having an instance ?
and whether it's a static function or method doesn't matter, the object is static final
Yeah he initialized it with Eager initialization
and initialized
I cant see the full code but
You're still getting the error @sick citrus ?
No, I'm not
You have everything contained within for() { } brackets right?
Ow then why are we even talking about this lmao
full stacktrace please
It's fixed anyway guys
xD
and @dusky herald no need for brackets since it's only one line
gotta love when problem fix itselves xD
And it's not even reached.
^didn't fix itself haha
I've had Intellij fuck with me before too lol
@dusky herald It's keySet if you want the keys, values() for the values, and entryset for both
BUT it was a null object and THAT was the problem.
And you're putting the Ips in there?
I forgot how...Player.getAddress().getAddress().toString()?
It's for custom MOTD
so event.getAddress() matching player cache (player.getAddress().getAddress().getHostName())
Hmm
it's crap most of the time but when it works it's nice
😂
Massive shame that ServerListPingEvent doesn't provide an UUID...
Like seriously, it could.
I do find it odd that it's not working
and provide a null for unauthenticated
Does it really need to be final though?
It is working now. intelliJ cache issue.
Ah
Dude seriously ?
I don't want to spam or bump too much in here, but would someone be willing to help me out with my issue? It's a bit of a bottleneck for me now, so I'm getting a bit desperate now haha. Got everything else on my todo list done now, so I'm back to being stuck with this issue now 😛
What
@naive stratus sure
Seriously what? Lmao
I cannot for the life of me figure out why I cannot retrieve the data in the pickup event... Modified the code a bit, removed the deprecated parts, but still same result. I can get the value and output it in the
onPlayerDeathevent, but still not inonEntityPickupItem. It will always output"You picked up unknown items"
- If someone could take a look at it, while I go for lunch, that would be great. Would really appreciate it!
Main: https://pastecode.xyz/view/b6b95042
Score: https://pastecode.xyz/view/479c736b
@naive stratus
@sick citrus
I find it odd you can even have issues with IntelliJ cache rofl
Bugs me to much to be stuck on this. It should be so simple. I do this for a living! lol (Not Java though, this is my first)
do you not have to update the persistent data container ?
after setting items in it ?
I have no experience with it but maybe it's just like itemStack where you need to .update() at the end ?
I was looking for something like "commit" or anything last night, but couldn't find anything that made sense
Okay so does it have to be any entity or just a player?
Just players will work for me
It's deprecated blackveiled. And it doesn't matter.
^ Yeah I guess as long as I get an ItemStack in the event, it doesnt matter which event it came from.
I'm referring to the EntityPickupEvent now
Not the Player one
Are you cancelling the event?
No
You can see everything I do in the two pastes. That's all of the plugin, except for the plugin.yml ofc.
can you not event.getItem().getPersistentDataContainer() ?
it might not be the same itemstack
@dusky herald IDEA cache does bug from time to time 🤷♀️
Not really that often though, but if you spot something that shouldn't be possible, go ahead and invalidate cache 🤷♀️
I think I've had that bug less than 10 times (probably around 5)
I use IDEA for the past 6 years
I've never encountered any cache issue besides not recognizing dependencies from time to time
and used it since it came out in i-dont-know-what-year
@naive stratus
can you not event.getItem().getPersistentDataContainer() ?
@sick citrus
@sick citrus I'm trying that now
it makes sense that it's not the same itemstack
you will have to store the data per-item as well, rather than per itemstack @naive stratus
@obtuse rose I don't know, maybe I restart the IDE often enough ?
🤷♀️
@sick citrus How come I cannot just do it per stack? I am just interested in knowing who dropped a stack, for when it's being picked up again next time.
Did you try event.getItem().getItemStack()?
That's still okay in my case. I will also take the stack amount into account, in what I am doing, so I can accept that.
One other way you can do it, but you lose persistence across reloads/reboots, is to store it in your own hashmap
Oh I only just realized now that it does not drop the entire thing as a stack
But as single items
so per-item 😛
I thought they were supposed to combine as they dropped
Eh w/e
Goin to bed tired as hell
They combine on the client, to not see 64 items on the ground
and you can actually disable that.
And it doesn't make an itemstack.
can someone please help me
https://www.spigotmc.org/threads/5-server-constant-ping-lag.431522/
Im having serious issues
I am unable to do anything
alot of factions have already quit
=[
What kind of host are you using ?
Dedicated
Details please
there is no TPS lag
alright
i
64 gb ram ddr3 (or 4 i think)
480gbps ddoss prtection
Well there's no point in having your ram details if we don't have the rest :
- server startup flags
- what else is running on the server
- what company host it
- what OS are you on
- what system tweaks you made
Using a dedicated is something that's not easy, and there are an incredible amount of factors that play a role.
From the explaination I get from your post, it seems to me like someone is using VoxelSniper a lot...
(also I'm curious to know what client mod you use for flying, if any)
...so it's not a dedicated ?
So it's not a dedicated :}
well
i bought a dedicated
they just set it up for me
I got it from Aquatis
what do u mean by what else is running
I disabled EVERY server except for factions to see what was causing htis
I don't see anything in Aquatis that allows you to have a dedicated machine. The most you may have is a VPS.
with a skript do i install like a normal plugin
Are you using a VPS for minecraft? >.<
no
they dont have dedicated on their web
I contacted through their discord
they setup a private server 4 me
not a vps
It's a vps.