#help-archived
1 messages · Page 164 of 1
json chat?
i dont think he can code own plugin
True
i'm back
He should learn tho
then, what the fuck are you talking 😄
its too mcuh for this simple shit
you know, no body will code its own chat plugin for just want
and no one will learn from scratch for just this
meh its 2am here, 2 hours until sunrise
6 hours until my wakeup time sooo
gn everybody
in intellij?
yes.
there should a lamp
click it
and you can google everyting about intellij
note: learn creating arfifacts for exporting jar
i'll look at that first then.
wut?
talking about char which similar to "|" ?
or login leave message?
if first, google for that chars
im speak arabic xd
https://prnt.sc/td1lvc how this ?
google translator is good
ok wait
gone to sleep se ya later
ok cya
do you mean message on join zaid
Does anyone know if there's any way to use the PacketPlayOutEntityVelocity for only one component? Due to ping, setting the clients velocity periodically causes huge stutters and completely overrides their current velocity.
is it allowed to ask for help here but not with spigot ?
kk np
Hello, in console I am receiving an error related to "Not a JSON Object:" the line in question that is giving me the error would be 6 | https://hastebin.com/kaxokibinu.json
In my experience this worked fine, but with the update I don't know if anything changed.
this my code i use in plugin: https://hastebin.com/ujariqewaq.cs
I've looked on SpigotMC's Jira and have not seen this as a documented issue (net.md_5.bungee.api.ChatColor and using net.md_5.bungee.api.chat.TextComponent#fromLegacyText). Has this been seen by anyone other than me? - Version 1.16.1
You'll get the same with the new hex stuff, you have to reset inbetween
oh wait
I totally misread that lmao
Lol
Yes, that does not reset formatting
&r Doesn't reset (even though that's....what it's supposed to do), &f Converts to white, doesn't reset styling (bold, italics, etc...)
Afaik there's not a way to toggle off bold after parsing, which is...an issue
I don't see the issue
im having an issue where every time i try to create using buildtool it always makes it to 1.15.2
--rev 1.16.1 add to the end of the command
will it give me the latest 1.16.1 tho?
why wouldn't it?
cause when i do latest it said it couldnt find it
latest points to what is deemed as the latest stable build
which doesn't always coincidence with the most up to date version as far as commits go
afaik that reset issue was fixed in newer builds
(commit says italics, but it's all formatting)
Basically, update your server lol
explains why I didn't see the issue
Anyone got the mc client source handy?
Looking for how the client deals with PacketPlayOutEntityVelocity from the server
Is there a way to play videos in minecraft?
so i'm online and it says to do --bukkit.command.plugins
--bukkit.command.help
where and how do i do that?
can i ask here for plugin recommendation?
shure.
i'm searching for a motd plugin
do it in gen chat.
oh
wuups
Can I ask a question regarding spigot plugin development here?
Been stuck on a problem for a while
yes
I've been trying to add metadata onto mobs that have been hit by a player. I implemented that for melee weapons etc just by using an onEntityDamage event. However, I can't seem to get it to work for bows. Here's what I have:
@EventHandler
public void projectileHitEvent(ProjectileHitEvent e)
{
if (e.getEntity() instanceof Arrow)
{
Arrow arrow = (Arrow) e.getEntity();
if (arrow.getShooter() instanceof Player)
{
System.out.println("[pHE] Shooter is instance of player");
String bowmanUuid = ((Player) arrow.getShooter()).getUniqueId().toString();
e.getEntity().setMetadata(bowmanUuid, new FixedMetadataValue(this, "placeholder"));
}
else
{
System.out.println("[pHE] Shooter is NOT instance of player: " + arrow.getShooter());
}
}
}
@EventHandler
public void projectileLaunchEvent(ProjectileLaunchEvent e)
{
System.out.println("Projectile launch event shooter: " + e.getEntity().getShooter());
}
@EventHandler
public void onEntityDamage(EntityDamageByEntityEvent e)
{
if (e.getEntity().isCustomNameVisible() && e.getEntity().hasMetadata("id"))
{
if (e.getDamager() instanceof Player)
{
System.out.println("Added Metadata of player: " + e.getDamager().getUniqueId().toString());
e.getEntity().setMetadata(e.getDamager().getUniqueId().toString(), new FixedMetadataValue(this, "placeholder"));
}
else
{
if (e.getDamager() instanceof Arrow)
{
Arrow arrow = (Arrow) e.getDamager();
System.out.println("Damager is instance of arrow");
System.out.println("Arrow: " + arrow.getName());
System.out.println("Arrow Shooter: " + arrow.getShooter());
System.out.println("Arrow UUID: " + arrow.getUniqueId());
//System.out.println("Shooter Class: " + shooter.getClass());
if (arrow.getShooter() instanceof Player)
{
System.out.println("Shooter is instance of player");
String bowmanUuid = ((Player) arrow.getShooter()).getUniqueId().toString();
e.getEntity().setMetadata(bowmanUuid, new FixedMetadataValue(this, "placeholder"));
}
else
{
System.out.println("Shooter is not instance of player...?");
if (arrow.getShooter() == null)
{
System.out.println("Shooter is null??????????");
}
}
}
}
}
After onEntityDamage .getShooter() kept returning null, I tried using projectileHitEvent, but getShooter() on that kept returning null too. Same for projectileLaunchEvent.
try updating spigot to latest version
there was a bug i reported where Projectile#getShooter() kept returning null
Sorry, how do I do that? I'm new to spigot :/
yeah 1.16.1 is still in developmental stages so updates are rolling out fast
I see, thank you
just git bash again and do java -jar BuildTools.jar --rev 1.16.1
I'll try that
assuming ur on 1.16.1
Has the bug been fixed for you?
Sweet it works, thank you 🙏
no problemo
does world decoration vary by environment now?
im currently having problems cuz i updated my plugin to 1.16
i had custom worlds generate with a set biome throughout the entire world, and it could pick between different environments (nether, overworld, or end). back in 1.15, an end and jungle combo would properly generate all the jungle trees and leaf bushes and stuff, but now it just generates the end pillars
Is it true that we can retexture damaged Minecraft items and make them look different based on durability?
you can even use CustomModelData now as of 1.14
so u dont have to use durability anymore
but yeah u can
Isn't the latest version great? lol
ye
anyway going back to my previous question is there any way to make biomes generate decorations like normal in different dimensions / environments?
Hi, I haven't played minecraft in 9 years and I just came back. I used to use a bukkit server but saw that this was basically the replacement? I'm just wondering how to disable spiders xD
just spiders in specific?
You could use WorldGuard and disable spawning of spiders
kinda
https://www.spigotmc.org/wiki/what-is-spigot-craftbukkit-bukkit-vanilla-forg/#:~:text=wiki%2Fbuildtools%2F)-,Spigot,make%20CraftBukkit%20shrink%20in%20shame.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
in a word, yes
it supports plugins like craftbukkit
for a longer technical answer that link probably goes into detail
You can define smaller regions, or set flags for the entire world
which is the global region
so you can set a flag for which mobs can spawn, and include whatever mobs you don't want to spawn
so Worldguard is a bukkit plugin, that can be used in spigot?
yes
both craftbukkit and spigot use the bukkit api, meaning bukkit plugins can be used for both
Okay I have WorldGuard and WorldEdit installed, but I cant find the command for disabling spiders haha
/rg flag global something?
how do i override the help, pl ,? , plugins commands and tab autocomplete.
Specifically you'd set the deny-spawn flag for your global region for your overworld
https://worldguard.enginehub.org/en/latest/regions/flags/#mobs-fire-and-explosions
I think the region has underscores: __global__ ; you should be able to use a command to list all of the available regions - /rg list
If you're good with MCEdit please DM me ❤️
Has someone updated MCEdit to work with the latest versions? been a while since I used it
MCEdit..... haven't heard that name in years....
I think it works with 1.15.2
Last time I used it was back in 1.5.2 lol
Because the map for my server got an update, and they edited a big part of the map that would be really messy to try to load in with worldedit
So the only thing that really comes to mind is MCEdit
Unless there's something else lol
well, if you know the regions that the part of the map are in
I do.
you could copy over the region files maybe and do a forceupgrade?
Huh?
is it forceupgrade or update? I can never remember the flag
What mc version is the map that contains the regions?
Both are cross-version. I think they were made in 1.13 but I use them in 1.15.2
I can check
are you expecting this map to be used on a 1.16 server/world?
No but I wouldn't mind updating if all my plugins are up to date.
Which they might be, I was able to successfully update one of my other servers.
Well, what I did when I upgraded to 1.15, is figure out where each of the regions are in each world/dimension for areas that I wanted to keep, and then just copied those to the appropriate folder for a 1.15 server. Then I just used the --forceUpgrade flag when I started the jar, in my batch/startup script. Once the server updates all of the chunks, you can then comment out or remove the --forceUpgrade flag.
If you have a really large world, with a lot of chunks/regions, it might take some time.
Alright, then I misunderstood
It's all on the same version, they just edited it the map lol
But it's just such a big portion that doing it with worldedit would be messy.
Not impossible but messy.
I just made the assumption that you were trying to take part of an older map and use it in 1.16
Is there any better solution to this apart from MCEdit or WorldEdit?
When you say "they edited the map" what exactly was changed? Player's placed blocks or built in the area?
You said the map is currently used in 1.15.2? I think you need to clarify exactly what you need to do.
Okay so the map is a map of a city, a really big city (not REALLY big in size, only about 20,000x10,000, it's just big in build density), and the creators of the map update it every few months. In this update, the entire northwestern part of the city was overhauled and redone, and I want to upgrade to it but if I do, all my progress on the map I already have will be lost. I don't care about the progress being lost in that northwestern part, but if I completely upgrade, the entire map's progress will be lost.
I need to find a way to some how copy and paste the part of the map they edited onto the map I have.
so one option: make a copy/backup of your versions regions; create a new world using a copy of your map, figure out which regions you want to keep and which regions apply to the new northwestern part.
Copy over the regions for the northwestern part. You have to figure out if there's any overlap of a region into a part you want to keep
and maybe use world edit for those parts in areas with an overlap. Basically you're talking about merging sections of two maps
well overwriting one section, and keeping your changes for the rest
a region is 512x512, so you have to figure out the extent of the northwestern part of the city, and which regions it falls into.
https://dinnerbone.com/minecraft/tools/coordinates/
just find the corners of the northwestern part and use that coordinate tool to figure out which region files it falls into
https://gyazo.com/80e8cca64414a778b84e1cec36bbb1c4 how can I create NBT that looks like this?
What the fuck is that?
server called cosmicprisons with custom enchants, they store all of their enchant levels in NBT data
Just get a custom enchants plugin
Im a developer lol
Im making my own custom enchants
in fact i've already done so but I couldn't find out how to do the NBT quite like this
Do like most people do.. "Research" other peoples code and make it better
I've already got a good system but I couldn't find anything like this with NBT
Welp that's what they get for hiring an entire development firm
one guy pretty much solo'd that project, I've done it before but I wanted to improve my code structures
IronMan_59 maybe try looking into PersistentDataContainer
This is using 1.8 are you sure that works
?
It's possible that they're using a modified jar that allows persistent nbt data storage on entities in 1.8.8
Imagine using fossilized versions of the game instead of modernizing
^ That is most likely the case, and they probably paid quite a bit for it.
Hello o/
that can be a dumb question but i'm using now spigot on 1.16 without any plugins and, is it normal than i get a full stack of dirt when i use a TNT ?
As of 1.14 TNT now has a 100% drop rate in vanilla MC
Ah! Well, it's been a long time since I played, lol. Thank you @frigid ember
no problemo
@frigid ember any other ideas for how I can get NBT to look like that?
Im still searching for a solution
no idea
i know its possible with vanilla commands
ive done it with vanilla commands
but idk how to do it with spigot
Hmm I might have an Idea
https://hastebin.com/ebuhamonus.java
i'm getting an internal error
Caused by: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
at me.totalfreedom.smp.commands.BanishCommand.onCommand(BanishCommand.java:32) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.16.1.jar:git-Paper-77]
You see
stop the server, rebuild
hi @ashen siren
i had the same issue the other day, i believe it is with Player player = getPlayer(args[0]);
yeah it is
you gotta put that after you check that args > 0
if (args.length == 0) {
sender.sendMessage(ChatColor.RED + "Usage: /playerstats <username>");
} else {
Player player = Bukkit.getPlayer(args[0]);``` here's what i did
appreciate it
np
The thing is - if you look at his code, he's returning early if args.length == 0. And thus, like electroniccat said, the stacktrace does not line up with the code
oh i didnt see that
is there a spigotmc.org api?
I also made a Java wrapper: https://github.com/robertlit/SpigotResourcesAPI/
Is it possible to run code after the plugin manager has run all listeners?
Like how exactly does spigot use cancellable
nice robertlit thanks
Is it possible to run code after the plugin manager has run all listeners?
@buoyant path use EventPriority
No I mean like in my custom event
You call the event.
And after you check if it was cancelled.
oh
Like how exactly does spigot use cancellable
All the handlers are run, all accessing the same instance of the event, then there is a check if the event is cancelled
I see
@fossil shoal do I have to shade it into my plugin?
Yes
okay
Any paid gadgets plugin suggestions?
(just for gadgets)
not other cosemtics
(tag with reply pls)
paid?
use a cosmetic plugin (first one I found: https://www.spigotmc.org/resources/gadgetsmenu-1-8-1-16-1-free.10885/) and give your players only the gadgetmenu permission
AwardItemsExecutable awardItemsExecutable = (items, commandsExecuting) -> {
RewardPlayerEvent rewardPlayerEvent = new RewardPlayerEvent(items, commandsExecuting);
Bukkit.getPluginManager().callEvent(rewardPlayerEvent);
if (rewardPlayerEvent.isCancelled()) return;
for (AwardableItem rewardedItem : rewardPlayerEvent.getRewardedItems()) {
Player playerRewarding = rewardedItem.getPlayer();
ItemStack itemRewarded = rewardedItem.getItem();
if (playerRewarding.getInventory().firstEmpty() == -1) {
playerRewarding.getWorld().dropItem(playerRewarding.getLocation(), itemRewarded);
continue;
}
playerRewarding.getInventory().addItem(itemRewarded);
}
for (String command : rewardPlayerEvent.getCommandsToExecute()) {
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), command);
}
};```
so theoretically this should work?
with checking it being cancelled
Yes. If you want nothing to happen if the event is cancelled, this will work.
Ok thanks 🙂
hello, this has nothing to do with my own projects but i have found a bug. On our server, (which runs spigot 1.16.1) if you go trough an end gateway, the server crashes.
if anyone knows a fix, please @mention me
@harsh stone Do you have a crash log by any chance this is not the first time i had someone tell me this and id like to figure out why it crashes
no, i do not have acces to the console of the server, i have found a bug report from a user with the exact same problem: https://hub.spigotmc.org/jira/browse/SPIGOT-5801
@harsh stone is there like an error in console or something
oh oops
didnt see the last message for some reason
haha, check the link, there you can find a log
what plugins are you using
none right now, normally discordsrv
yeah, tomorrow we have the first enderdragon fight so we are thinking about switching to vanilla until this bug is fixed
oh yeah, i should try to crouch through!
ill try that when i get home thanks!
https://gyazo.com/581ecf7742a1e187165d010e8c7e0fb1 how too this ? portal how
@harsh stone update spigot
is it fixed in the latest version?
It’s been fixed for a while
Had you taken a minute and searched the javadoc, you'd have found this: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/scoreboard/Scoreboard.html#getEntryTeam(java.lang.String)
declaration: package: org.bukkit.scoreboard, interface: Scoreboard
Maybe player's name
depends on whatever plugin you use
it should be %player%
because this seems to be the placeholder standard anyway
why do you substrACT?
Hello, I downloaded 1.12.2 map on 1.15.2 server, but when enter world client lags
Why it occures? --forceUgrade didnt help
@harsh hill What do you mean by "client lags". If you upgraded all chunks you should be fine.
@frigid ember You should get the maxHealth and use it as base value.
First, I installed map, and then --forceUpgrade, but it did not help me, it tooke 10 seconds
set it to (currentHealth - maxHealth/4)
getMaxHealth * 3/4
Oh, sorry, can it be because chunks not loaded on server?
you still need to decrease the player health
Is it will be more effective if get health 1 time and store it?
player.setHealth(player.getHealth * 0.75)
Or if you want a percentage of the max health, player.setHealth(player.getHealth - player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue / 4)
hello
On my server, if I set spawn protection to like 10000, and set the gamemode to peaceful, will this prevent hunger and block breaking, or should I use a plugin?
does any1 have a clean 1.8.9 decompiled minecraft coder pack?
mcp for it is not available (i think)
Wait...
if (proj instanceof Arrow) {
if (p.getHealth() == 20) {
p.setHealth(15);
} else if (p.getHealth() == 15) {
p.setHealth(10);
} else if (p.getHealth() == 10) {
p.setHealth(5);
} else if (p.getHealth() == 5) {
p.setHealth(0);
}
@frigid ember Pls dont do that.
switch
I wouldnt even use a switch.
Just reduce the health of the player by 25%
Show me your code
I meant 25% of the players max health ^^
so get the max health and then p.setHealth(p.getHealth() - (maxHealth * 0.75))
Did you remember to cancel the arrow damage?
Because if not it just gets added on top
event.setDamage(0)
cancel would also prevent knockback and enchantments etc
Try giving it a potion effect? If not you need to extend NMS Arrow and set it to invisible.
You can only do it to living entities
if (proj instanceof Arrow) {
if (p.getHealth() == 20) {
p.setHealth(15);
} else if (p.getHealth() == 15) {
p.setHealth(10);
} else if (p.getHealth() == 10) {
p.setHealth(5);
} else if (p.getHealth() == 5) {
p.setHealth(0);
}
@frigid ember p.setHealth(p.getHealth() - 5) 🤫
Cause imagine if your player regenerate to 18 for instance, then he won't take any damage
I mean if a player has more than 20 max health then subtracting 5 wouldnt be 25% anymore
You never know. A cheat client with FastRegen will fail your system ^^
Can't you just use player.setHealth(player.getHealth() / 4) ?
Imagine a graph @fossil shoal, it is not linear and it will never reach 0
Not a graph but a suite
sequence
@peak glade Can you make a clear question please?
why ?
We don't understand
Sorry, what I meant is setHealth(getHealth() * (3 / 4))
Same
you understand
@fossil shoal
You never reach 0
This is close but not 0 ^^
Zaid are you meaning: What is the plugin they used to make a friend system?
ok sorry nothing
is it possible to make a plugin that can work both on spigot and bungee?
and separate main classes?
well yeah
different main classes
you can have a shared core
where it doesn't contains code from either of the builds
thanks
Compile against the 1.8.8 API and don't use any methods added after that version lol
To make your life easier, compile against latest and use what methods you need. If you don't use anything added after, say, 1.9, then boom you have 1.9 - 1.16 support
version support sucks in general
Not if you use API 🙂 My VeinMiner plugin has supported 1.13+ for quite some time now
I use API exclusively. Don't even have to update
you extract it as a method
oh variable
extract it as a field
if you implemented the commandexecutor in main class
extract the variable outside
👌
yes
the variables inside the methods are local scoped
well
you did somthing wrong lol
Anyone know where I can get a plugin that removes mutually exclusive enchants?
I can't program
I could try it but it would be a lot easier to just find one
I'm on 1.16.1
Yeah, the problem is that there isn't much support as it's new
I'll give it a go
I'm just running an SMP for me and a couple if friends so it's not essential it would just be nice to have
Ok cool thanks
If you ever do just message me, I can pay you a bit if you want me to
userdata.getUserFile().set("data.amountEnchanted", enchantgilde.amountEnchanted.get(userdata.uuid));```
How would I do the same for a HashSet with an uuid
?
ohh srry
xD
can someone tell me a plugin that lets me play jukebox discs in a region
@frigid ember the plugin worked but doesnt have the ability to remove the mutual exclusivity
Guys i have a kit plugin. But when i do" /kit "chat says:
/Kit [player] its essentials Command how can i disable it ?
so i can run it on the server but it doesnt let me have fire protection and blast protection on the same bit of armour
@cerulean musk pretty sure its the the essentials config.yaml
aternos
i cant use citizens
its really bad performance but it works
you wont get anything good for free, it will work for a couple friends but not for lots of players
either self host or pay
@lyric anvil
Yup
i self host rn but how do i get an ip cos its like x.x.x.x rn
i have no money
:(
then you have no ip
:(
Topjam
Guys i have a kit plugin. But when i do" /kit "chat says:
/Kit [player] its essentials Command how can i disable it ?
wot abt freenom someone said
anyway
can someone heklp me bekause my serve rkeeps breaking and how i make an external backup script
i found it on youtube
yeah or just do it manually
userdata.getUserFile().set("data.amountEnchanted", enchantgilde.amountEnchanted.get(userdata.uuid));```
How would I do the same for a HashSet with an uuid
:p
it cost money 😭
how i do it manulay
but i want to use /backup
Where do I get the mysql connector jar?
literally the first results, do some googling before you come to discords
then add minecraft
:|
not every result on the internet is about minecraft
im not dumb
clearly
can someone change my nickname coz its not bicxter
¯_(ツ)_/¯
¯_(ツ)_/¯
I think the bot would just change it back
?
like if they right clicked you and changed your username the bot might change your name back to bicxter
how do api plugins work
like the kind where you have to have the plugin installed on the server for other plugins to work
Does anyone know if there's any way to use the PacketPlayOutEntityVelocity for only one component? Due to ping, setting the clients velocity periodically causes huge stutters and completely overrides their current velocity.
It would be nice to just override one component
how do api plugins work
like the kind where you have to have the plugin installed on the server for other plugins to work
Define "how do they work"? What all do you want to know?
The short is that they're loaded first so other plugins can just use 'em
@subtle blade I think it would be good to have seperate channels for dev help and plugin help
Something you'd have to bring up to md. I can't make nor manage channels
sorry for the bad explanation
basically, I want to make a plugin that does some stuff, and I have like some methods that other plugins can call. How would I set it up so that other plugins can talk to my plugin
that's what I'm trying to figure out
does spigot load all of that stuff
As long as your methods are public and accessible through some means, you can use 'em
ok got it
Bukkit loads all plugins through the same classpath
If you want to use another plugin's API, it has to load first though. depend: [plugin, otherplugin] or softdepend: [plugin, otherplugin] in the plugin.yml
soft meaning your plugin won't fail if it's not installed
Optional dependency, if you will
ok got it
yea thats in plugin.yml I know that much
ok this all makes sense thanks for the help
userdata.getUserFile().set("data.woodGildeAccess", new HashSet<>());
how would I link this to my hashset
choco ur a god xd
tell me :p
does task.isCancelled() also check if it completed?
Hey,
I'm trying to do something with PacketPlayOutPlayerInfo.PlayerInfoData, but I'm getting this fancy problem when compiling:
Error:(23,32) java: cannot access net.minecraft.server.v1_12_R1.PacketPlayOutPlayerInfo.PlayerInfoData
More:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/IntelliJ/ServerSystem/src/main/java/me/Entity303/ServerSystem/Vanish/Packets/VanishPacket_v1_12_R1.java:[23,32] cannot access net.minecraft.server.v1_12_R1.PacketPlayOutPlayerInfo.PlayerInfoData
bad class file: D:\sfsfsfsfsf\Spigot\Spigot-Server\target\spigot-1.12.2-R0.1-SNAPSHOT.jar(net/minecraft/server/v1_12_R1/PacketPlayOutPlayerInfo$PlayerInfoData.class)
bad RuntimeInvisibleParameterAnnotations attribute: PlayerInfoData(com.mojang.authlib.GameProfile,int,net.minecraft.server.v1_12_R1.EnumGamemode,net.minecraft.server.v1_12_R1.IChatBaseComponent)
Please remove or make sure it appears in the correct subdirectory of the classpath.
[INFO] 1 error
[INFO] -------------------------------------------------------------
Anyone knows how to fix that? It works with 1.8 to 1.11, but not 1.12+
PlayerInfoData is broken
well idk how to fix it maybe others know
PlayerInfoData is broken
So, I'm stuck with a 1.8 - 1.11 plugin 😐
well there probably is a fix, I tried looking for it but never found it
well there probably is a fix, I tried looking for it but never found it
Yeah, protocollib does it too... So there IS a fix. But idk how either 😐
No. Java 8, but was using Java 11 for a little time
then I would check your settings for the version you are trying to compile for
lol
Yeah, protocollib does it too... So there IS a fix. But idk how either 😐
Ok, apparently the fix is very simple.
Just do some more reflection:
Class<?> clazz = null;
try {
clazz = getClass().getClassLoader().loadClass("net.minecraft.server.v1_16_R1.PacketPlayOutPlayerInfo$PlayerInfoData");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Well, I only tested this in 1.16.1 so I don't know if this is gonna work in older versions
It won't
You're hard-coding the version. At that point, you might as well directly use NMS
hey
@frigid ember I didnt follow the conversation but this is not how you should use reflections.
If you get the whole class path you can as well just use plain NMS and be several hundret percent faster.
Well, the compiler won't let me use PacketPlayOutPlayerInfo.PlayerInfoData
So I have to do it like that to not use PacketPlayOutPlayerInfo.PlayerInfoData
You're hard-coding the version. At that point, you might as well directly use NMS
I know... Thanks for pointing out something I know...
I meant if it works if I replace the 16 with a 13, if it will work on a 1.13 server then...
Also: This is just a test, not the finished code. I will make it version independent
You want an instanc of PacketPlayOutPlayerInfo.PlayerInfoData ?
Yeah
And at the moment I use PacketPlayOutPlayerInfo.PlayerInfoData, the compiler won't let me
PlayerInfoData is not a static class.
That means you need an instance of the enclosing class (PacketPlayOutPlayerInfo) to get an instance of PlayerInfoData
This is the constructor
PacketPlayOutPlayerInfo.PlayerInfoData data = playerInfo.new PlayerInfoData(null, 0, null, null);
My compiler won't even let me use this...
As I said:
As soon as I use PacketPlayOutPlayerInfo.PlayerInfoData, my compiler won't let me:
Error:(23,32) java: cannot access net.minecraft.server.v1_16_R1.PacketPlayOutPlayerInfo.PlayerInfoData
Ah i see. Why would you need an instance from PlayerInfoData. Makes no sense now reading the class... its just used for internal purposes.
Yeah, but I want to manipulate the data that's in that class: The GameMode
Use this constructor
And how to set the gamemode? 🤨
As you can see, the gamemode is stored in that inner class and is automatically set
You need to set the gamemode of the EntityPlayer you are sending.
Sure, but then the player is really in that gamemode and that's exactly what I DON'T want.
I want to send to other players a fake gamemode. So players see a specific player in spectator mode (as a head).
If I just set the gamemode of the player, I wouldn't need any packets at all.
But nevermind. It seems to work with my reflection code.
So there is no real need to discuss that anymore.
Don't worry, I will make it version independent and try to improve it
Sure but at least cache your reflections
That's what I meant with "try to improve it"
Why do certain redstone components not work in chunks loaded with chunkloaders but without players present?
Also with the /forceload command
Is anyone else having issues with Multiverse Core/Nether Portals and Spigot?
My server is struggling with having multiple worlds.
this isn't really a spigot question but
is it possible to read raw console input? like I don't want to get a string after the user has typed some thing in, I want to get a string as they are typing it in
(in java)
nvm nvm nvm
I figured out some stuff
I have to put the terminal in raw mode and its completely different across systems
Is it possible to message a player a variable (java plugin)? Like I want to message the player's inventory (getInventory()) but I cant figure it out, any idea?
message?
- Guys How Can i Upload resources with price on SpigotMC.org ?! *
haha
Is there a way to check if an entities bounding box is colliding with world voxels using spigot's bounding box stuff?
could some one help me to fix this problems https://image.prntscr.com/image/y010A3EbRxaAkzACzpDy9w.png
that should be formated number
and this is second problem with color codes
this is config
@spare tiger Thanks ! ❤️
@frigid ember I'm pretty sure protocollib can help with this
Is it possible to message a player a variable (java plugin)? Like I want to message the player's inventory (getInventory()) but I cant figure it out, any idea?
Is this possible?
Yes
In that case, how?
@mellow wave https://gyazo.com/46fc14b9f27921ddfe89c20500964c91
Yeah you're reading the file with UTF-8 but is the file saved with it
@weary cargo You can use Player#sendMessage, convert what you want in to a String and send it
> [17:05:56 WARN]: Skipping Entity with id 50073601
> [17:05:56 WARN]: Skipping Entity with id 50073601
> [17:05:56 WARN]: Skipping Entity with id 50073601
> [17:05:56 WARN]: Skipping Entity with id 50073601
how to fix this?
it spams 24/7
@frigid ember I'm pretty sure protocollib can help with this
@wheat mirage
Well, I didn't want to depend on protocollib just for that 😅
Protocolllib is superior in every way
@shy shard That looks correctly set but look at what the text says now
Use protocollib even if it's just for one thing @frigid ember
^ It's easier
Bukkit.getWorlds().stream().mapToInt(World::getEntityCount).sum()
Would this return only entities in LOADED chunks in all worlds?
I asume so
Use protocollib even if it's just for one thing @frigid ember
Not everyone uses protocollib, shocking, but true.
I didn't want to lose functionality just because a user doesn't have protocollib, also it's just one thing, that's why I didn't want to depend on protocollib either@wheat mirage
😈 shade NMS
Shading ProtocolLib in my plugin? 😅
Doesn't ProtocolLib only function when installed as plugin?
I never tried it as shaded
You could probably shade it by why
Doesn't ProtocolLib only function as a plugin?
Yeah, that's what I thought. I don't know if it is really so. But I'm pretty sure
Most servers install it anyway because of other plugins
it wouldn't work i think because it needs it's on enable functions or something like that
You call the methods yourself
@tiny dagger do you know fix?
> [17:05:56 WARN]: Skipping Entity with id 50073601
> [17:05:56 WARN]: Skipping Entity with id 50073601
> [17:05:56 WARN]: Skipping Entity with id 50073601
> [17:05:56 WARN]: Skipping Entity with id 50073601
spamming 24/7
You call the methods yourself
You can't get an instance of the main class because a PluginClassLoader has to get the instance
Looks like something is wrong with an entity not much more we can know from that
is that map converted or something?
how do i determine if one method from the Bukkit API is safe to call from another thread?
assume that it isn't and move on
just try it and see if it breaks 😈
I guess
you can't try the getter methods
?paste
It’s actually pretty easy to make packet listeners on your own
?paste
But efficiency is always a concern
@hollow thorn please use that link to share logs
com.javaminecraft.StaffWeaponUse.onStaffWeaponUse(StaffWeaponUse.java:312)
^
These two lines will always be your best friends in a stacktrace:
Caused by: java.lang.NullPointerException
at com.javaminecraft.StaffWeaponUse.onStaffWeaponUse(StaffWeaponUse.java:312) ~[?:?]```
Tells you what the exception is and where it occurred
the error only happens when i use an item which was coded in a different area
?paste
if(e.getItem().getItemMeta().getLocalizedName().contains("wand")) why this no work
item is null?
Because those methods can return null.
getItem(), getItemMeta() and getLocalizedName() can all be null
getItem(), getItemMeta() and getLocalizedName() can all be null
ItemMeta#getLocalizedName() never be null, there is@NotNullannotation
oh i forgot to use the e.getItem != null in the if
Localized name isn't nullable? I was under the impression that it could be
np
well ItemMeta definitely is ;P
yep
@hollow thorn Check if getItemMeta() is null, as well.
hasItemMeta() will suffice
Hello, I would like everyone to have access to the whitelist command, should I program it in the permissions.yml file?
The permissions.yml is not a permission manager, it is more used to create "custom" permission packages.
hooo okay
is there an event for when you open your inventory with e
InventoryOpenEvent doesnt trigger on that
There's an issue with ChatColor.RESET not resetting formatting (Evidence below). It was documented and fixed here https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/1601ec31e3ef864f324369a315ec586bee4f8e33, but I am still experiencing it. Something else that is odd is that in '1.12.2' the issue still persists even though this is only a behavior in 1.16+. I checked my plugin jars and I am not compiling the API alongside the plugin...any ideas as to why this is happening?
This could be an issue in BungeeCord, since I am using that API in the plugin aswell.
import net.md_5.bungee.api.ChatColor;
String coolmsg = "RED cool cool cool!";
coolmsg = coolmsg.replace("RED",ChatColor.of("#ff0000").toString())
does this work?
https://tryitands.ee @hasty crag
uh guys spruce and birch trees arent supposed to generate in the jungle right
https://tryitands.ee @hasty crag
wow, you guys are so nice
thanks so much for the help
without you i'd be nothing
key to pleasure unlocked
try it and see
thats wow
❤️
tbh those people should get admin
Not wrong though...
Fuckin' try it lol. That's the easiest way to see if it works
i'm a lazy fluffy panda
I wish unit testing for Minecraft existed

@frigid ember the clients inventory status is never sent
So no it’s not possible to detect when they open their inventory
oh rip
yeah i looked more into it and you used to be able to by detecting the achievement for opening your inventory but they removed that one
What if they use their crafting table and craft something? Will the server know that? My guess is it will.
Intersections are sent, just not whether it’s opened/closed
@sturdy oar you can use mockito to mock spigot api objects
and then proceed with unit testing whatever
or you can implement dummies for the tests you want to do
unit testing is realistically unviable
Like, you can test some aspects of a plugin, but, going any deeper into trying to test against how users act, etc, glhf
not sure if this is the best place to ask for help with this but where is my plugins folder??? https://gyazo.com/750004ce6cf863d6fce1d210410d7598
I generated spigot with buildtools and ran it with the normal .bat procedure
the foler should be created unless you have some oddity
make sure that you ran it after accepting the eula
I did
I deleted everything and reran it after accepting the eula
and still no plugins folder
Is checking for 0 health on a Damage Event a good idea?
A Death event isn't really giving me a DeathCause
Not but LivingEntity has getLastDamageCause()
hm. Good idea
Returns you an EntityDamageEvent from which you can get causes, etc.
It's nullable, so just keep that in mind
You have no spigot.yml either
@lone fog
uhh i think so
according to the spigot wiki, what I followed, running "java -jar BuildTools.jar --rev 1.16.1" in git bash in a folder with buildtools should generate a spigot.jar, but i dont think it is because it generated something called "minecraft_server.jar"
So im not sure that I even have a spigot server on my hands
use --compile Spigot after the --rev arg
--compile spigot is redundant
That's default
Just --rev 1.16.1 is fine
It won't ever generate minecraft_server.jar. Let it do what it needs to do
I wish unit testing for Minecraft existed
@sturdy oar
You can make it
make an assertion framework on top of some java bot API
and then just spin up a server
when(client.sendsCommand("/ping"))
.thenExpectChatResponse("Pong");
or something like that
Howo to I copy a file from the jar to the config folder? What do I need to import for getResouceAsStream()?
how do i make it when i right click an npc it rtp's me to another world
i use citizens and betterrtp
@fringe cairn https://hub.spigotmc.org/javadocs/spigot/org/bukkit/plugin/java/JavaPlugin.html#saveResource(java.lang.String,boolean)
declaration: package: org.bukkit.plugin.java, class: JavaPlugin
Anyone know how to get rid of the square brackets around custom item names?
anyone familiar with this api? https://bukkit.org/threads/1-8-particleeffect-v1-7.154406/
@frigid ember https://wiki.citizensnpcs.co/NPC_Commands
One of the common things Citizens users want is the ability to have NPCs run a command when right-clicked.
is it your own plugin?
its essentials
Go to config.yml and create a permission for the kit under the kit section
how do i make a world that is void?
with mvc
Do we want to give users anything on first join? Set to '' to disable
This kit will be given regardless of cost and permissions, and will not trigger the kit delay.
#kit: ''
kit: tools
this ?
u use perm essentials.kit.something i think
Simple question here what do you experience has 1.16.1 server instability at this moment with your test / in generals
Sinply asking cause some are saying they got multiple instability
how do i do make a hollow sphere with we
so I made it so you can ride any mob by clicking on it, but idk how to make it so you control them, anyone know how to do that?
so you can contol what you ride?
Non-OP'ed players can't use /sell or /w with Essentials.
then add a rank with luckperms or smth and put in perms essentials.sell
How would I go about having some sort of nametag over a players head such as naming an animal?
would it be Entity#setCustomName()?
wdym
When a player joins the server their name is displayed above their head indefinitely. I want some sort of thing like that, maybe above their nametag
guys, is there any way to control chunk loading? i feel like my players generate too many chunks (might be flyhack)... i already took care for entities and reduced view distance, yet with 50 players, i have 4400 chunk loaded and 2000-3000 entities. server runs on flags from aikar tutorial, java 11...
any way to control chunk loading?
on your onCoomand, are you returninf true or false?
Depending on what you return that message will get sent or not
How do I register a command with spigot?
from on enable event
like bungeecord getServer().getPluginManager().registerCommand?
Hi, I tried updating my spigot server and now I can't seem to start it... the spigot.jar seems to point to the old spigot-1.15.2.jar file. I do have the spigot.1.16.1.jar file in the build folder 🤔 but I deleted the old one
this.getServer().getPluginManager().registerEvents(xx, this); xx=classname
this.getServer().getPluginManager().registerEvents(this, this); in main
but you first have to register the classname above
private final Xx(realname) xx(subname) = new Xx(realname)(this);
@fringe cairn
How to properly save a hashset to yml?
its a hashet saving an UUID
any1?
is there a way to set multiple names on an entity and show both?
Thank you
Any way to set individual players to offline mode? With a bungeecord plugin I could use initalHandler.setoffline or whatever
I made it so you can ride any mob by clicking on it, but idk how to make it so you control them, anyone know how I could do that?
@frigid ember you can iterate through it in a for loop, after all, it implements Iterable
wait
So I have this
public static final HashSet<UUID> woodGildeAccess = new HashSet<>();```
People get added to this hashset when staff members performed a command,
```java
userdata.getUserFile().getBoolean("data.woodGildeAccess");```
Checks if the boolean of the player is true onJoin
so now I want to do something like:
userdata.getUserFile().set("data.woodGildeAcces"), woodGildeAccess.get(userdata.uuid));```
but get won't work in a hashset
how do i change a citizens npc skin to a url i want this https://www.minecraftskins.com/uploads/skins/2020/07/07/sick-simp-knight-14765878.png?v234
Of course get "won't work" in a hashset
It's a set
also how do i change the format of the skin so its 3 pixels on the arm
yes so I need something like the same as get
but for hashsets :/
What is it you want to "get"
data of the players uuid
ohh no wait
You already have the uuid
thats onJoin
But how would I save the data than?
onDisable
you might want to use a hashmap
ohh yea
and do it UUID + Boolean right
that'll do I think
If you're just going to store the data only if they have been "promoted", I would rather use a set in code and a list of strings in the yml
If the set contains the uuid, I add it to the list
instead of using woodGlideAccess.get, you could just use woodGlideAccess.contains, I'd assume that would have the same effect.
Yes, because there is nothing to "get" from a set
It's a set lmfao
I mean, in the case of the hashset, the object itself is the index within the set
so I have a custom bow but when it gets damaged it becomes a different item to the listeners
how would I fix that?
I still want it to be able to break
You have to check it in a way that ignores durability
ok and how would I do that?
how can i make a runnable run for only a certain amount of ticks?
@kind berry Pretty sure you can check for the localized name rather than it being the exact itemstack
localized name shouldn't be the same name as another item or else it can get messed up, display name can be the same tho
shrug
int cutOff_Time = 5 // ticks
new BukkitRunnable() {
int current = 0;
public void run() {
current++;
if(cutOff_Time <= current) {
cancel();
}
}
}.runTaskTimer(JavaPlugin, 0, 1);
Something like this @tiny pebble You take 2 values the current amount of ticks and the max ticks you want. Then run cancel() after you reached the ticks you want.
ah thank you!
Np
Uh so I just got warned for spam on this server? I barely posted 3 messages??
By automoderator
Only 4 bots you sure its not a troll
Well I've had that bot send me messages before so
Screen shot it then. Are you sure its for this server?
YAGPDb.xyz msged me with:
SpigotMC: You have been ⚠Warned
Reason: Automoderator:
Please do not spam.
Don't know. Might have to wait for staff on that one.
You just sent the same message more than once
What?
Asking if the java thing was possible?
I just quoted my original message with is this possible bc nobody said anything
@tiny pebble oh works perfectly thanks 😄
👍
hi
any report of bug that the mobs is not moving ?
and i maby two day or more of minecraft is going normal
I have so many questions regarding the plugins, it'd take alot of patience to probably put up with it, can someone help me out in DMs?
I just got a spigot server and Im trying to set up a nice world for me and a few friends
I've had issues with some plugins
and I have a few questiosn
i just bought a plugin, after paying thru paypall i can not download it.... can someone solve this?
Hey does the playerlist not support hex colours as well as chat in 1.16?
@shut estuary You'll have to contact who ever the owner of the plugin is
Anyone know how I can make an entity invisible but have its name still show up?
Possible problem:```java
UserDataHandler userdata = new UserDataHandler(player.getUniqueId());
if (userdata.getUserFile().getBoolean("data.enchantGildeAccess")) {
HashMap:```java
public static final HashMap<UUID, Boolean> enchantGildeAccess = new HashMap<>();```
doesnt give errors but doesnt work either :/
I want it to __check__ the boolean in the players file (im saving hashmaps per player) so it will execute something when its on true
UserDataHandler class -> https://paste.helpch.at/acikezitim.cpp
I payed for lite bans but didnt get the resource
contact author
Anyone know how I can make an entity invisible but have its name still show?
Anyone know how I can make an entity invisible but have its name still show?
Don't think thats possible... however you could have an invisible armorstand with the name riding the invisible entity.
what could i do to make the armostand invisible and showing its name then? haven’t figured that one out either.. just potioneffect or..?
ArmorStand#setVisible(false)
ah cast it to armorstand, alright
might also want to set Marker true too
what does that do 🤔
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/ArmorStand.html
"Sets whether this armor stand is a marker, meaning it has a very small collision box."
declaration: package: org.bukkit.entity, interface: ArmorStand
basically makes it act more like a placeholder than a regular armorstand
is tehre a PrepareItemSmithEvent or something like that?
(for smithing table)
Does the Player#getLocale work well?
Loading libraries, please wait...
[23:21:46] [main/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', name='PROD'
[23:21:47] [main/FATAL]: Failed to start the minecraft server
net.minecraft.server.v1_16_R1.SessionLock$ExceptionWorldConflict: /home/pi/minecraft/./world/session.lock: already locked (possibly by other Minecraft instance?)
at net.minecraft.server.v1_16_R1.SessionLock$ExceptionWorldConflict.a(SourceFile:98) ~[spigot-1.16.1.jar:git-Spigot-c3a49df-2a18108]
at net.minecraft.server.v1_16_R1.SessionLock.a(SourceFile:44) ~[spigot-1.16.1.jar:git-Spigot-c3a49df-2f18108]
at net.minecraft.server.v1_16_R1.Convertable$ConversionSession.<init>(Convertable.java:198) ~[spigot-1.16.1.jar:git-Spigot-c3a49df-2f13108]
at net.minecraft.server.v1_16_R1.Convertable.c(Convertable.java:180) ~[spigot-1.16.1.jar:git-Spigot-c3a49af-2f18108]
at net.minecraft.server.v1_16_R1.Main.main(Main.java:97) [spigot-1.16.1.jar:git-Spigot-c3a49df-2f18148]
at org.bukkit.craftbukkit.Main.main(Main.java:202) [spigot-1.16.1.jar:git-Spigot-c3aa9df-2f38108]
any ideas whats causing this?
running debian 1.16.1
2 options:
- Another server is already running on the world file
- The server doesn't have the permission to edit the world folder
Are there any resources you guys know of that discusses how to change weapon skins without forcing items to be that skin?
so i should run it as sudo ig?
@undone narwhal seems like it was running a second instance somehow
thanks
So if I wanted to add a new weapon skin to the game, and call it a Zombie Sword or something, how would I add it without making it a lime dye or something like that?
Is that even possible?
Cool Variez
Maklegend this is possible this 1.9+
But I never checked how to do it
You can make the player auto download a resource pack
And create a new texture
And tell the player that the item use the new texture
I see
But it has to be on an existing item
Possible problem:```java
UserDataHandler userdata = new UserDataHandler(player.getUniqueId());
if (userdata.getUserFile().getBoolean("data.enchantGildeAccess")) {HashMap:```java public static final HashMap<UUID, Boolean> enchantGildeAccess = new HashMap<>();``` doesnt give errors but doesnt work either :/ I want it to __check__ the boolean in the players file (im saving hashmaps per player) so it will execute something when its on true UserDataHandler class -> https://paste.helpch.at/acikezitim.cpp
@frigid ember
You'll still be able to get the normal diamond sword
Hmmm are you sure about the ""plugins"+File.separator+"KDGilde"+File.separator+"users"" ?
Try removing plugins folder
is there a way to kill the current running session as I described the issue above?
like can i can terminate the mc server?
hey does bungee works for 1.16.1?
@frigid ember look into CustomModelData
@frigid ember First locate the running PID of the mc server and do "kill <PID>"
To see all running process: ps -aux
But that is not what caused it @undone narwhal :/
Anyone ever have an issue where someone buys their plugin but they're not on your plugins buyer list?
The paypal transaction checks out
But they're telling me that they don't have access to the plugin and they're not coming up on the buyer list
If I have:
if (player.getNearbyEntities(50,50,50) instanceof Player) {
}
What would I put within the if statement to basically state that the entities that are players get sent a message? Would I just it to Player?
getNearbyEntities returns a List<Entity>, you need to loop through that list and check if the loop entity is a player.
if so, send it a message.
Does this still work, or do I have to do something to modernize this:
entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(health);
I heard 1.16 screwed with attributes
@tiny pebble You need to iterate over every Entity.
player.getNearbyEntities(50,50,50) returns a List<Entity>
ah okay, thank you. i'll see what i can do 😛
Hi, i am using YamlConfiguration provider to load my yml files from the BungeeCord.jar, but when plugins load ymls named the same (for example messages.yml) they load the one on the bungeecord.jar instead of the one provided by the plugin.jar. What can i do?
I am trying a different path atm to see if it fixes it
nope.
Any easy way to create configuration files via java instead of saving a resource inside the bungeecord jar?
Quick question, so if I have ``` ArrayList<String> enabledMobs = new ArrayList<String>();
hey does bungee works for 1.16.1?
Quick question, so if I have ``` ArrayList<String> enabledMobs = new ArrayList<String>();
@frigid ember Collection#add does not create anything new
It just add an element
Alright thanks! I guess I gotta use a hashmap
Idk what you're doing 🧙♂️
its complicated to long to explain xd
||hey does bungee works for 1.16.1?||
for (Entity value : entityList) {
if (value instanceof Player) {
value.sendMessage(message);
} else {
return;
}
}
shouldn't this work?
It loops through every entity and checks to see if it is a player, if it is it sends a message. no message is sent though
Where do you get your entity list from?
List<Entity> entityList = player.getNearbyEntities(50,50,50);
Are you certain this piece of code is executed?
Oh wait
You are returning if it's not, so if the first entity is not a player, it will stop the loop.
Put a "continue;" instead.
Thank you so much! Rookie mistake I guess haha, wasn't really thinking
System.out.println("1");``` why isnt this event ever running? I registered it in main and its not erroring nor printing
Me neither lol, late at night.
Are you missing the @Eventhandler annotation, @frigid ember ?
No worries.
world.getNearbyEntities(50, 50, 50, e -> e.getType() == EntityType.PLAYER).forEach(p -> p.sendMessage(message));```
Just, yeah. That is a thing you can do
I'm definitely going to use this somewhere, oh my.
[01:03:58] [Worker-Main-4/INFO]: Loaded 7 recipes
[01:04:00] [Worker-Main-4/WARN]: Found validation problem in {minecraft:entities/shulker}.pools[2].entries[0]: Unknown loot table called minecraft:entities/reference/extra/shulker
[01:04:00] [Worker-Main-4/WARN]: Found validation problem in {minecraft:entities/ender_dragon}.pools[0].entries[0]: Unknown loot table called minecraft:entities/reference/extra/ender_dragon
none of the plugins ive got installed are creating custom crafting recipes
BungeeCord directions say to copy the file to the bungeecord directly, but the latest build has multiple files. Do I download all of the files into my bungeecord directory?
Anyone knows of good/rich resources on reflection? I might need to get into it but I want to be prepared beforehand lol
talking to you, choco xd
Does anyone know what is the new "RGB" of minecraft colors in chat?
@wary spoke as in what is supported?
if that is what you are asking, the colors that are supported is the same as the range of hexadecimal
which is somewhere in the 4millions
STN-Studios to use them u have to use net.md_5.bungee.api.ChatColor.of(String string), and then put in ur hex code in as a string
to get hex code from colors u can literally just google rgb color picker and google has one for u
How do I check if a human entity is sneaking?
okay thanks
ye
in my plugin, i have certain abilities that a player can use, but im right now trying to put in a block that, when players are near it (within a certain range), they cant use these abilities.
right now my idea to do this is to have the block use PersistentData and everytime the player uses an ability, i have to test all blocks near the player, but i realize that testing so many blocks is probably gonna lag down the server. is there any more efficient way of doing this that doesnt require testing every single block in a radius?
NullPointerException: Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_251] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_251] at com.benyji.core.mobs.SpawnerController.mobSpawned(SpawnerController.java:57) ~[?:?] SpawnerSpawnEvent gets a hashmap with the spawnrs location and stores a list of the mob enabled, why is this erroring out when a place a second spawner down? they seem to be interfering not sure why, this is line 57: List<String> entityList = enabledMobs.get(spawner.getLocation());
String entity = entityList.get(r.nextInt(enabledMobs.size()));
^ is line 57
you are checking the array for something that doesn't exist
or you are assuming indexing starts at 1
which it doesn't it starts at 0
That exception isn't thrown by a hash map
oh by the list? but how can that be null if I just initialized it the line before?
List isn't null either. You're pulling something from that list that doesn't exist
i.e. that list you have has only 1 element, but you're pulling index 1 (which is out of bounds)
Oh so your saying it is expecting 2 elements?
String entity = entityList.get(r.nextInt(enabledMobs.size()));
This is your error line, correct?
Look at what argument you're passing to nextInt()
yup
You're trying to get an element beyond the end of the list
so it should be enabledMobs.size() - 1?


in my plugin, i have certain abilities that a player can use, but im right now trying to put in a block that, when players are near it (within a certain range), they cant use these abilities.
right now my idea to do this is to have the block use PersistentData and everytime the player uses an ability, i have to test all blocks near the player, but i realize that testing so many blocks is probably gonna lag down the server. is there any more efficient way of doing this that doesnt require testing every single block in a radius?
@frigid ember also anyone have a better idea than this?
now im thinking i should add block to arraylist or something instead
(1) PersistentDataContainer isn't an option here. Only tile entities have NBT. Regular blocks do not
(2)
now im thinking i should add block to arraylist or something instead
Yes
I believe so, yes
aight imma try that
how do i get rid of the tab completion for a command?
Of a command not provided by your plugin? TabCompleteEvent is your friend
i could try saving it to config maybe?
Yes, you'd have to write those positions to file, potato
thats gonna be one long ass file
A database may be better
how about of a command that is provided by my plugin 🤔
I just don't want it to auto-recommend the users names
Or you could loop all tile entities on chunk load and add it to the list then
Not perfect, but it doesn’t require any external storage
You can implement TabCompleter (or TabExecutor if you're also implementing command logic, just a utility class that combines the two) and return Collections.emptyList()
blockState.update();``` is being run but isnt replacing the spawned mob, no errors either, should I be canceling the event 'SpawnerSpawnEvent'?
Then you're good to go