#help-archived
1 messages · Page 153 of 1
does YamlConfiguration.loadFromString() replace what was already loaded into that config?
probably
All the values contained within this configuration will be removed, leaving only settings and defaults, and the new values will be loaded from the given string.
How do I get a user's profile picture from spigot?
What I know:
I can get it using the user id, so for example the user id is 31119, the url would be https://www.spigotmc.org/data/avatars/l/31/31119 .jpg (choco was the first person I found xd)
The 31 is floor of user id / 1000 and then there is the user id.
What I don't understand:
The letter "l", how do I determine which letter would be on that position, I saw for some users it was "s"?
why?
(I didn't mean to embed)
big doggo
Something I am working on @torn robin
automated access to the spigot site is prohibited iirc
i'm pretty sure this would go under that rule
A contributor of spigot suggested something like that for resource pictures on github
Is there a way to use normal minecraft tags with spigot? So like I give myself an item with /give and give it the tag "damage:22b" is there a way to read this Tag in spigot?
what exactly are you trying to do Trixone
and @fossil shoal what other letters are possible?
i'd look for some pattern
it looks like most are l
Let me see, I saw one with s
I'm trying to create a System in which you can create custom Weapons just by giving them to yourself and the tags define how much damage it will deal
if you're worried specifically about damage you can get the item's metadata and cast it to Damageable
make sure you import the correct version
org.bukkit.inventory.meta
No the system doesn't work with vanilla damage it a bit complicated I just don't know how to get the tags of an item
If it's works at all
why are they intermixing?
I actually am using this Api but it doesn't seem to work if I give the item an NBT tag through /give
Are there any /wild plugins that work with 1.16.1
yes
Well gg I think it's some other problem xD
99% of the ones that work with 1.15.2
there's no reason for a properly written wild plugin to not work on 1.16
What ones bc the one im using doesn't and it works with 1.15.2
Guys do you know how to "normalize" the name of the sender while sending a message from another thread?
I'm sending messages concurrently but they show up with the ForkJoinPool in chat
i'd look for some pattern
Looks like the letters l and s
@fossil shoal look for like 3 s's
look for if there's anything similar to all three
@sturdy oar pretty sure that's just a host thing
or however you have it setup
if you wanted you could change how your plugin logs messages
I can't find one that works with 1.16
i noticed it started doing that for me personally when i started using the internal logger
@formal arrow I guess there aren't any that work with 1.16 then
Ohh nvm I think I underatand, l means large, s means small
nice
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
why can't I post photos
You need to verify yourself
well can I post imgur links
Seems legit
that's how you get lag during ping flood attacks
Yeah I'm such a moron for spending my time on that
so I have those problems with my craftplayer.java
let me show you the lines where the problem is
the 1.16.1 builds are flying out atm aren't they 😄
is it a custom craftplayer class?
why is it there?
well i'm making a prac server and I need to have better knockback
so I tried making some changes
i think a plugin would be better suited no?
don't think a plugin can do exactly this but now I already have done all this
wait this is 1.7
yes
no idea
Have you been able to export correctly before you started editing the class?
yes
if I remove this part of code it works
K I figured it out
yes?
You're missing the @NotNull annotation
oh ok
lmk if it works
i always just remove that
Yeah it's not in CraftEntity aswell
Probably not the issue
The NotNull annotation is from sun
I always get it from jetbrains annotations
@ember heart I fixed 3 errors
2 left
the hardest ones
at the @Override line, it says error: method does not override or implement a method from a supertype
The issue is pretty clear
this is the only error I need fixed
it's pretty clear
so I should remove it?
https://wiki.vg/Chat in 1.16.1, can I not use § for setting colors?
you should still
is setting the color property the only way?
oh good, I don't wanna set color properties
I want to make my own plugin
What program to use?
Notepad++?
I want to make a plugin that you can do /gm 0 or /gm 1 and not /gamemode creative
Install Eclipse IDE or IntelliJ IDEA
Wich one is best
Start with Eclipse I guess
Eclipse?
Is this the good site
That I dont download virusses
I have to pay
nvm
what next
This is in the installer
@naive goblet
Eclipse 🤮
what
Imagine using eclipse in 2020
yeah
Sorry
PacketPlayOutChat packet = new PacketPlayOutChat(); did they change the API of this class?
Please dont be mad at me for using eclipse
I want to run a command when a user clicks on a message, I was trying to achieve this by sending a playoutchat packet, https://wiki.vg/Chat
@naive goblet what do I need to click next
do whatever you want, if you like 2006 UIs i guess it's fine
why not use Intellij, it's easier to develop plugins
ok i use that then
How can I make a user run a command when they click on text in the chat?
There are IDE plugins that can directly help you create plugin projects
Seems like I need to send a JSON packet, but all the threads seem outdated
@spare wolf https://www.jetbrains.com/idea/download/
It's not hard to manually create the plufin project.
Yes I am already downloadning it
Plugin
I fount it
Community edition is pretty much enough for someone starting
argh I dont know why I chose the name CallMeMe I am getting annoyed by it
Can I change it
or not
Also IntelliJ has an amazing Kotlin support (... since they made it lol)
You can I think
?
have you never done an installing lol
Yes I do
just install
I don't remember, that install wizard is only for Windows, an operating system I've never used
speed
and
Play World of Warships for FREE at https://wo.ws/37qYLRQ
New players can use code BATTLESTATIONS2020 to receive 1 Million Credits, the USS Charleston, 3 days premium time, and more!
Thanks to World of Warships for sponsoring this video!
IOS, Android, OSX, Windows….. Now for L...
I watch LTT all the time
This one comes with this
the IntelliJ is do ne
I will DM you so we dont clutter the server
oh I cant
You can't
I don't have DMs enabled
Because I used to just get spammed with help and stupid stuff
I will click accept then
Btw, on my server there seems to be a problem regarding mob spawning in nether, do any of you know what it could be? There hardly spawns any hostile mobs at all
If there are a lotta players online in different parts of the nether the mobcap will be spread out so there well be less mobs
Well yes but I'm alone :/
@spare wolf TL;DW of that video, its rlly lightweight
if you can get away with using linux, good for you, but i honestly cant be bothered
but there are probgrams that arent for linux right
Structure generating does still not work on the latest build
is there some event which can be used to make mobs not pathfind to a player?
I am using event.setCancelled(true) on afk players dying to make them immortal, but creepers is still an issue
I'm trying to execute a command sync, not sure if I'm doing it right...
i tried changing gamemode, but it actually teleports the player ~-0.5 blocks on the y axis
I'm getting this error when building, with the code given above, I tried googling but found no results
I'm unsure how to resolve this issue
@harsh anvil linux is definitely better than windows for a minecraft server, but windows is easier to remember so i stick with that
oh yeah for sure
download the build thing again
for servers always use linux
I'm hosting a couple servers on Windows and it is far nicer than linux
but I might someday switch to using ubuntu server and use a tool like tmux
how do you screen with windows?
I'm on linux rn, and I'm developing and running servers on it... I don't think it's as hard as it used to be
"screen" with windows?
I'm hosting a couple servers on Windows and it is far nicer than linux
@frigid ember 🤮
how dare you say that
screening is accesing your terminal from somewhere else, in a sense
you mean ssh?
not exactly
ssh makes a new terminal session, but to access your server you must connect to the same terminal
there are workarounds, of course
with linux, ive never been able to configure anything to start with it
but still: how do you screen on windows
@sturdy oar it's cool to navigate
yeah like using services to run the mc server
what do you need to configure on linux, banan?
stuff to start with linux...
it's not as hard as you think it is
i just start my minecraft on a tmux -S /tmp/myserver and then attach to it through tmux -S /tmp/myserver attach ezpz
like in windows, you have a startup folder
you can even connect from various machines if you're using a socket, which is nice
ive tried it before, no luck at all
I would setup a service, which starts on boot, so that you don't need to manage it manually
if you're up to it, banana, I can help you
i change my server too much for a service to be an optimal solution
https://discordapp.com/channels/690411863766466590/690470011382267904/727498595913171036 is this the correct way to execute a command synchronously?
how can I send a message to a player from another thread?
rather: I am doing stuff from a listener, and want to send a message to a player
which listener?
oh, so I can schedule it to the main thread even from the subthread?
various, tbh
right now, PlayerDeathEvent
listeners are on the main thread tho
I'm sending death coords to my players
eventlisteners right?
yeah
just get the player from the event
I was trying to AsyncChatEvent or whatever it was called yesterday, and it wouldn't want to work
ponging the player for testing
hmm i forgot how asynchat event works 🤔
triggered when a player sends a chat message
I tried a simple event.getPlayer().sendMessage("hello to you too") and it wouldn't work :(
yeah, it sent an err message complaining about using sendMessage() from a subthread
can you show the stacktrace
uh, I deleted it, but could do it again
There's nothing wrong with sending messages from other threads
i currently do that without any issue
well its not guaranteed to be ran async
🤔
could it be a paper issue?
read
wait, really?
so it's not sending a message to the player, but rather from the player?
I'm pretty sure Player#chat makes the player send a message
that,,,,,, makes sense
he said he was using sendMessage tho?
he's... not?
"as the player" could help the description
well its commented out either way
i did, my memory failed me
i commented it out since it failed, but uncomment it to get the err
try with sendMessage
cannot access BaseComponent
class file for net.md_5.bungee.api.chat.BaseComponent not found
why are you using bungee packages for this smh
i honestly don't know where that comes from, I never imported bungee
how do I get the plugin from outside the main class?
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.entity.Player;```
it might be a paper thing, though
@ionic sun dependency injection
no I meant, https://hub.spigotmc.org/javadocs/spigot/org/bukkit/scheduler/BukkitScheduler.html#runTask-org.bukkit.plugin.Plugin-java.lang.Runnable-, this method requires the plugin
how do I get a instance of it from outside?
its really as simple as just passing the plugin to the constructor
pass it to the constructor of the class you use the scheduler in
oh yeah right, how did I forget that
hey guys, anyone have an idea on how i can add an NBT tag to a chest
like my own custom NBT tag
what's the best way to add custom variables to players? subclassing or adding them to an arraylist with attached uuid?
@reef folio blocks dont keep their NBT tags when placed
Is it possible to save a Time/Date using FileConfiguration?
or will I have to make some parser myself
@median tinsel depends what your goal is
you can parse time using java builtins from string
awesome
how do you send clickable urls, commands, hover etc?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
@harsh anvil i have players in different cities, so I want to assign them to different guilds, they might have different races/classes, info about being afk, their usernames on other platforms...
isn't that bungeecord only?
bungee api is included in spigot
@median tinsel well then you probably want classes that take a player as argument
bruh I have visited that page multiple times but quit because I thought it was bungeecord only 😭
and link them to your guilds
well that makes life so so much easier
player rather than uuid?
well if you remove the reference when they quit its fine
but then I will lose the info when they dc, or do some wizardry onconnect
you would save the data somewhere.
^^
json, yaml, sql are some possibilities.
but can you save a "player instance" anywhere? won't it change on next connect?
write the data as it changes, but keep the altered version in memory, then remove it when the player dc's
i'm just thinking uuid is permanent
write the UUID
you'd link the UUID to the player's data.
but use the player internally
yeah dont go reading it from disk every time you need it
load in memory when they join or something
or when its needed
i was gonna search for player with uuid on getServer() but probably smarter to just do that once
you can use Bukkit#getPlayer(uuid) to fetch a player based off their uuid.
i think bukkit caches it for you, but i'm not sure
probably easier to just deal with player instances anyway, so I don't need to repeat getPlayer(uuid) each time anyway
i don't need uuid for anything other than saving data anyway
how can I add a new configuration in the spigot.yml file
so I don't need to build it over again and put it back into the server and restart it
so I can just reload/restart and yeah
So, my friend is having issues connecting to the spigot server I just set-up but I can join it just fine using my local address. I have forwarded port 25565, sent him my IPv4 etc, but I must have missed something. Would someone be willing to help me troubleshoot a bit? I can share screen
Nevermind, like always, after asking for help I almost immediately solved it myself
I wish you all a good day/night!
Heya, i have this problem with NuVotifier, i wanted to go on their discord, but couldn't find it anywhere, can somebody help me here?
We can VC to help.
Have you checked their troubleshooting guide?
yep, nothing worked.
do you really have to make a code to edit nbt attr or is there a plugin that can modify it?
1.16 has /attribute
You can’t unless you have a manual way to handle it
Spawners don’t store the mob type in item form
hey, how do I disable the join message on bungee and spigot?
Join message?
yeah...
Like player has joined the game?
yes...
I think essentials can do it
https://www.spigotmc.org/resources/disable-join-message.4138/ might also help
what about in bungeecord?
Hi, I'm trying to implement an /invsee command. I make a player A open the inventory of a player B, and force them to update their inventories at each interaction. It works really well for the top inventory, but the bottom inventory is very glitchy, some slots cannot be interacted with, and others, when clicked, put the item on the other player's armor (?_?). I really don't understand wtf is going on, does someone have an idea ?
I could also create an inventory and copy the content, but the previous method seems a lot simpler
I dont know whether or not this is a spigot issue but im using 1.16.1 and my server shuts down because the disk is malformed
org.sqlite.SQLiteException: [SQLITE_CORRUPT] The database disk image is malformed (database disk image is malformed)
nvm
I read the log
@subtle blade Yesterday I asked about "how do I make sign changes appear for all players", and you sent me this:
@Override
@EventHandler
public void onSignChange(SignChangeEvent event) {
BlockState state = event.getBlock().getState();
if (state instanceof Sign) {
Sign sign = (Sign) state;
sign.update();
}
Statics.getPlayerMap().get(event.getPlayer().getUniqueId()).onSignChange(event);
}```
but, its not working. You see anything wrong here?
Because its still only updating for the player who interacted with the sign
and not for all players
loop through all online players and send the sign change event
Dear all! Please help me to find a plugin. I'm searching for last week for solution already. I want to find a plugin that have possibility to create 2 currencies where 1 is a chest-shop currency and second works through mysql and there is a possibility of exchange one-way
@opal bay you shouldn't have to do that. Events are sent to all players, and this code is written at the top level. It should still be sent to all players.
Really!? There is no plugin that do chest-shop and multicurrency?
@opal bay you shouldn't have to do that. Events are sent to all players, and this code is written at the top level. It should still be sent to all players.
@frigid ember I did something similar once. I think you have to put the update in a BukkitRunnable and run it on the next tick
Don’t do it in the sign change event
Do it when you want to change the text on the sign
I fire this event off tho after its edited nPlayer.getBukkitPlayer().sendSignChange(event.getClickedBlock().getLocation(), args);
I suppose that doesn't matter?
Just seems weird to me I guess
Yes but you don’t have to use send sign change
Use the sign state to change it
sendSignChange() changes the lines on the sign only for the client of the player on whom you’ve invoking that method
Using the Sign state will change it on the server and update nearby players
it got removed
e.getView().getName()
Inventory views have names, not inventories
I just did viewer.openInventory(other.getInventory());, but it seems like some slots in my inventory corresponds to the other player's armor slots :/
Dear all! Please help me to find a plugin. I'm searching for last week for solution already. I want to find a plugin that have possibility to create 2 currencies where 1 is a chest-shop currency and second works through mysql and there is a possibility of exchange one-way
😦
I will buy a plugin if you can write it
Gab I don’t think that’s exactly supported
An exception really should be thrown if a PlayerInventory is passed. Maybe I’ll talk with md about that
:/
I looked out in forums, it seems to have worked with others
And i think that's how essentials is doing it
I really don’t think Essentials should be taken as a point of reference heh
😦
Why not? You’re in an InventoryEvent correct?
Yo, @tiny dagger @subtle blade that sign update event is not working, even after invoking in the method that the interaction is made
So what about it isn’t working?
Far too much
That too is too much
it changes it to the colored text, then changes immediately back to black
You can get away with 4, maybe 6 if you have more people
“Ah we have a lot of RAM left! No need to remove unused stuff!”
on all the time
So no need to overun the server with much RAM??
No definitely not. You’ll end up performing worse
so for some reason when I listen to the PlayerInteractEvent and right click a block, it fires twice
but not when i right click air
I tried seeing if I had registered it twice anywhere but cant find anything
you need to have an item in hand to interact with air
And for the double firing, I think that's because of the off hand
i am doing it with an item
it fires once when i right click on air, which is what i want
but it fires twice on right clicking a block
and i dont have any item in my off hand
it's maybe because your are interacting with the item and the block at the same time, so you have two interactions i guess
actually I think i see what you're saying now, because when i right click with a shovel or something in my off hand it fires
Does anyone know a way to know if a packet was sent by you when intercepting packets?
I'm trying to cancel packets that are generated by minecraft
@subtle blade @tiny dagger Sorry for the spam, but man this does not work
I added the sign update into the method where the player actually updates the sign
Now it sets the color of the sign, and then instantly sets it back to black even for the player interacting with the sign
does -DIknowWhatImDoingISwear need to be the first flag, or it doesn't matter?
actually.. does that flag still work?
nvm, it was -DIReallyKnowWhatIAmDoingISwear
java.lang.IllegalArgumentException: Symbol does not appear in the shape:73
at org.apache.commons.lang.Validate.isTrue(Validate.java:93) ~[spigot.jar:git-Spigot-a99063f-c9d7c16]
at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:128) ~[spigot.jar:git-Spigot-a99063f-c9d7c16]
at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:113) ~[spigot.jar:git-Spigot-a99063f-c9d7c16]
at com.javaminecraft.StaffWeapon.onEnable(StaffWeapon.java:149) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot.jar:git-Spigot-a99063f-c9d7c16]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:351) [spigot.jar:git-Spigot-a99063f-c9d7c16]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) [spigot.jar:git-Spigot-a99063f-c9d7c16]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugin(CraftServer.java:464) [spigot.jar:git-Spigot-a99063f-c9d7c16]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugins(CraftServer.java:378) [spigot.jar:git-Spigot-a99063f-c9d7c16]
at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:457) [spigot.jar:git-Spigot-a99063f-c9d7c16]
at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:274) [spigot.jar:git-Spigot-a99063f-c9d7c16]
at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:784) [spigot.jar:git-Spigot-a99063f-c9d7c16]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]```
@hollow thorn you gonna elaborate on that? lol
so?
i dont know whats wrong
smh
Is comparing a villagers loaction with one from the config a good idea? When the villager has, #setAI(false), #setAware(false), #setCollidable(false), #setInvulnerable(false)?
I have no idea how i can indentify if the entities are the same.
hm maybe there are unique values for a entity.
are you talking about a custom one?
Just checking if a villager is the same via a config.
oh ok
still broken
We can't help you here. We are not the developers of the plugin. Contact the developer if you can't fix that yourself.
its my plugin
🧙♂️
ah shit son 80%
Hello, im currently using Dependency injection for all my classes that i need my main class in, However theres two utility classes that i currently need to access my main class from (they're static) should i create a private static instance of my main class and a getter? what im doing right now is making a public void initialize method on them, and passing them over to my main class so my main class variable can get instatiated. should i keep doing that or should i make a static variable in my main class?
arch not user friendly 👺
@mild nebula why do you need your plugin instance in a static method
pacman go brrrrrrr
its installed boy
either way, you have 3 options:
- singleton / static instance variable
- javaplugin#getplugin and cast
- make utility class non static
S I n g l e t o n
whenever anyone here hears singleton i imagine they keel over in disgust
DoNt Use SiNGleTon ITs NoT sOliD
if i make a singleton should i use that over dependency injection?;p
me trying to remember password 
people will argue for each and every
at the end of the day it usually doesn't matter
Just use the singleton where you really can't do dependancy injection imo
i personally always use DI
i see, that makes sense
i usually just pass in plugin instance to static method
That works too
problem solved 🧠
just use a singleton for things you will only ever have one instance for...
you can't use that argument here, somebody will call it invalid
yeah ofc we're talking about the main class instance
I just have an initialization class and have it as a static variable
Gets the job done perfectly fine
The only thing I don't understand is...
why the hell my sign text changes only show up for the interacting player and not all players
This shouldn't be hard
what
I don't understand
code?
noob here trying to get the size of an inventory, but getting an error in IDE "Cannot resolve method 'getSize' in 'Inventory'"
if(manageHouseTransaction(event)) {
nPlayer = Statics.getPlayerMap().get(event.getPlayer().getUniqueId());
domain.addPlayer(nPlayer.getBukkitPlayer().getUniqueId());
String[] args = new String[4];
args[0] = ChatColor.AQUA.toString() + ChatColor.BOLD.toString() + "House";
args[1] = nPlayer.getNation().getChatColor() + ChatColor.BOLD.toString() + nPlayer.getNation().getNationName();
args[2] = ChatColor.AQUA + "Owned By";
args[3] = ChatColor.GREEN + nPlayer.getBukkitPlayer().getName();
nPlayer.getBukkitPlayer().sendSignChange(event.getClickedBlock().getLocation(), args);
BlockState state = event.getClickedBlock().getState();
if (state instanceof Sign) {
Sign sign = (Sign) state;
sign.update();
}
nPlayer.setOwnedHouse(this);
return;
}
Is there a secret I'm missing
@mystic forum I'm going to guess you don't have spigot as a dependency in your pom?
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
do I need to add spigot in addition to spigot-api?
everything else is working fine
just trying to .getSize() on and inventory
is broken
weird
it just fixed itself
broken how?
disregard me
o
retyped it for the 4th time, after trying other methods, and now it just works
🤷♂️
is there a way to "force" a spawn upon someone?
ie
when they join
they get sent to x y z?
on player join, wait a tick, teleport them?
@mystic forum it may not have been imported. control + shift + o for quick import
Thanks Mak, I'll give that a try if it happens again
Hello. I recently launched a spigot 1.16 server on BisectHosting. I used to host one on 1.14. However, when people play on 1.16 spigot server, it seems to crash after a few minutes and restart and then crash again a few minutes later over and over. The only plugins we were using was the Dynmap plugin that said was updated. Even without any plugins, the server would run for a few minutes and crash again so I've had to replace it with a vanilla minecraft server.
Will there be a new build released that will be more stable or have I done something wrong in setting up?
How do you get the name of an Inventory in 1.15.2 I always get an Null Pointer Exception when I use e.getView().getTitl()?
How do you get the name of an Inventory in 1.15.2 I always get an Null Pointer Exception when I use e.getView().getTitl()?
just do null checks and you won't get those exceptions anymore
I can't tell if thats ironic
Oh I do actually do Null checkd
just curious, is there a way to host a bukkit server with mods?
In the console it says "Title not set" even though it is set xD
what are you trying to do
Im trying to get the name of an inventory
oh right sponge
?xy
Asking about your attempted solution rather than your actual problem
Hey, my server crashed because of generator-settings in my server.properties
generator-settings=minecraft\:air;minecraft\:the_void;decoration
Wiki told me to escape the characters
my knockback on the server is weird
it works okay but when they hit w and a/d when they get hit, they get no knockback
and are able to escape from it which shouldn't happen
here are the parts that I changed
if (flag2) {
if (i > 0) {
entity.g((double) (-MathHelper.sin(this.yaw * 3.1415927F / 180.0F) * (float) i * SpigotConfig.knockbackExtraHorizontal), SpigotConfig.knockbackExtraVertical, (double) (MathHelper.cos(this.yaw * 3.1415927F / 180.0F) * (float) i * SpigotConfig.knockbackExtraHorizontal));
this.motX *= 0.6D;
this.motZ *= 0.6D;
this.setSprinting(false);
}
if (entity instanceof EntityPlayer && entity.velocityChanged) {
EntityPlayer attackedPlayer = (EntityPlayer) entity;
PlayerVelocityEvent event = new PlayerVelocityEvent(attackedPlayer.getBukkitEntity(),
attackedPlayer.getBukkitEntity().getVelocity());
this.world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
attackedPlayer.playerConnection.sendPacket(new PacketPlayOutEntityVelocity(attackedPlayer));
}
attackedPlayer.velocityChanged = false;
attackedPlayer.motX = victimMotX;
attackedPlayer.motY = victimMotY;
attackedPlayer.motZ = victimMotZ;
}
do bees cause a lot of lag?
I made it so I can change the knockback from the spigot config
Dishit, how many bees we talkin'?
yeah
They dropped the wander radius in 1.16 which should cut back on lag a bit
My limited experience, bees are OK, villagers are the worst offenders
ik
ItemStack pg = new ItemStack(Material.WOODEN_HOE);
ItemMeta meta = pg.getItemMeta();
meta.setDisplayName(ChatColor.GOLD + "" + ChatColor.BOLD + "Paintgun");
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_UNBREAKABLE);
List<String> lore = new ArrayList<String>();
lore.add(ChatColor.ITALIC + "Default paintgun");
meta.setLore(lore);
pg.setItemMeta(meta);
pg.addEnchantment(Enchantment.DURABILITY, 1);
return pg;
}```
is there a reason why when I add the paintball to a player's inventory using a command it doesnt work
You’re not giving it anywhere in the code?
Dishit, that is way too broad of a question. There are some general pointers for reducing server lag all over the place, and plugins to help with that
I left that part out oops
if (!(sender instanceof Player)) {
return false;
}
Player p = (Player) sender;
if (label.equalsIgnoreCase("paintgun")) {
p.getInventory().addItem(getDefaultPaintgun());
return true;
}
return false;
}```
thats my oncommand
Thanks @mystic forum
@frigid ember make sure the command is being run
and one more thing is it possible to make villagers less laggy. I am using villager optimizer anything else on the market?
@small bobcat two things: first, try SAML. It requires tuning to be a little more user-friendly, but it can nerf/freeze mobs. Unfortunately, you're kinda on your own for finding the settings/mob groups/etc for your server that you like
@torn robin i sent a message to the player when the command was originally run and it did run
not sure whats happening
second, (I may get hate for suggesting this here, not sure about the policy), PaperMC has some villager optimizations built in - you can get it / find out more on their site
we tried saml but like you said it freezes the villager and we can't move them into carts and etc.
alright i will check paper
@small bobcat SAML can be set to unfreeze villagers when you interact with them, so if you're trying to move them, just interact first, then move
but it all needs to be tuned
oh really by dumb brain never went through the config
SAML has infinite possibilities for how you define groups/when to freeze/when to unfreeze/etc. Default settings can be jarring (lots of freezing, slow to unfreeze)
unfortunately, there's not really a guide for "best" settings because it's all very specific to each situation (what are your farms like? what level of tolerance do you have for entity freezing? etc.)
so you've just gotta play around
make a copy of the default settings, in case you accidentally break something
alright
my knockback on the server is weird
it works okay but when they hit w and a/d when they get hit, they get no knockback
and are able to escape from it which shouldn't happen
here are the parts that I changed
if (flag2) { if (i > 0) { entity.g((double) (-MathHelper.sin(this.yaw * 3.1415927F / 180.0F) * (float) i * SpigotConfig.knockbackExtraHorizontal), SpigotConfig.knockbackExtraVertical, (double) (MathHelper.cos(this.yaw * 3.1415927F / 180.0F) * (float) i * SpigotConfig.knockbackExtraHorizontal)); this.motX *= 0.6D; this.motZ *= 0.6D; this.setSprinting(false); } if (entity instanceof EntityPlayer && entity.velocityChanged) { EntityPlayer attackedPlayer = (EntityPlayer) entity; PlayerVelocityEvent event = new PlayerVelocityEvent(attackedPlayer.getBukkitEntity(), attackedPlayer.getBukkitEntity().getVelocity()); this.world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { attackedPlayer.playerConnection.sendPacket(new PacketPlayOutEntityVelocity(attackedPlayer)); } attackedPlayer.velocityChanged = false; attackedPlayer.motX = victimMotX; attackedPlayer.motY = victimMotY; attackedPlayer.motZ = victimMotZ; }
is there a way to "force" a spawn upon someone?
ie
when they join
they get sent to x y z?
Hey, how to get all chunks GENERATED of a world ?
no just chunks generateds
Teleport them on the on join event is there a way to "force" a spawn upon someone?
ie
when they join
they get sent to x y z?
@frigid ember
Hello, switched to spigot api 1.16 today, noticed that InventoryType.GRINDSTONE no longer exists, what has this been replaced with?
onjoinevent, create a new location and then teleport them to that location
or essentialsspawn has that
i mean in terms of
what plugins there are
essentials spawn
is there a plugin which allows or has a way to spawn a mob e.g wolf with the name of the person that spawned it? i tried mcstacker that sells a wolf spawn egg and have the wolf spawn with the player name but %player% etc of the placeholders dont work... please @ me if you know
Is there a way to add certain permissions per set?
Ex. When you wear a full set of iron, you get fly permission, when you remove it, the perm also gets removed
Yeah
I can't find the plugin since the google is only suggesting me armor effects.
Oh a plugin?
Depends
Yeah if you code it
If you code it like that
Oh so i can do multiple diamond sets with different perms?
Perm?
I haven't tried coding yet but i guess tutorial can help me
Why’d need that
Fly perms
you see, i created some armor called Dragon Sets
and i want those sets to have flying perms.
Just when worn?
Afaik that’s possible with code and without perm
Yeah you can just check if the player has a peice of armor on with that name and then put them in fly
Not that easy
I feel like it is i did this before but it wasnt for a permission
What if another plugin clears the armor codewise etc?
Wouldn’t trigger an event afaik
Well no itemedit plugins would be able to achieve this I guess as it’s not their purpose
christo you don’t event need ItemMeta, could use NBT as well
Yeah you could, I usually just do itemmeta bc its a little easier, but ig like you said that could get changed
should I enable tcpnodelay on a 1.7.10 pvp server?
I guess im staying with high jump and speed effects
because the pvp is smoother
How?
Oh yeah another question, how do i edit the blue attributes
also I have a problem with the knockback
Blue attribute?
from the patches I applied
Just upgrade lol
MyItems does that but the attributes only works when its in the lore
it happened only when I applied the patches
Wym ixxa
so it might be something wrong with that
So lets say
Diamond sword
Damage: 200
Well I wouldn’t use 1.7.10 to start with, 1.8 should be minimum
if i remove the 200 damage lore the attr also vanish
The attributes only works when its in the "lore" not on the actual blue attributes
You see the lore "Damage"?
that overrides the blue attribute or the actual attribute
if i remove that, the attributes also vanish and turns it into the normal one
the plugin made it like that which is kinda not cool
If I kill all the mobs in a multiverse world, will it kill the mobs in every world or just the world I am in?
apparently 1.8 clients have a 0.4 wide hitbox
instead of a 0.3 wide hitbox
but f3 b shows a 0.3 wide hitbox
@opal heron How do I kill just the mobs?
What do you mean by that?
Every mobs in that place?
yes
Hm, i dont know a command that does that
but ClearLag can do that
but wouldnt mobs spawn again if you kill all of them?
Anyone know of a way that through Java I can get a file and turn that file into a downloadable link?
Hey guys, do you know an alternative to EntityPlaceEvent? (it is deprecated)
i think its org.bukkit.entity.event
Yeah but if there is an alternative event. Because it took me some time to find that one but I saw its deprecated and it doesnt recommend what we should actually use
Deprecated.
draft API
Maybe its because its under development? Or what does the draft mean?
Hello, switched to spigot api 1.16 today, noticed that InventoryType.GRINDSTONE no longer exists, what has this been replaced with?
How do I edit these in Multiverse? https://cdn.discordapp.com/attachments/412383444862238731/727619722731978792/unknown.png
Draft mean, it will be removed in future releases
Ty for that info
Use BlockPlaceEvent
It doesnt do what I want
BlockPlaceEvent isnt called when a player places an entity (or "creates")
In my case, I want an event to be called when for example, a player places an end_crystal in an obsidian block (and EntityPlaceEvent performs that perfectly)
Hello, switched to spigot api 1.16 today, noticed that InventoryType.GRINDSTONE no longer exists, what has this been replaced with?
@light geyser https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/event/inventory/InventoryType.java#128
Its not removed
Thats weird, getting this though GRINDSTONE cannot be resolved or is not a field
on if(event.getInventory().getType().equals(InventoryType.GRINDSTONE)) {
@quick harbor then use CreatureSpawnEvent
@light geyser you sure that you imported correctly the InventoryType?
And also check your project libraries, if you use maven build now
Don’t check the enum elements with Object#equals
imported org.bukkit.event.inventory.InventoryType;
Use ==
Will change that too
It's more fastest
idk if im allowed but i lost my backup codes on pc so i cant get in my account cuz of new phone and it didnt save my 2fa info
more fastest?
Draft mean, it will be removed in future releases
Maybe its because its under development? Or what does the draft mean?
@quick harbor @rare prairie Draft means it's subject to change
Yep, because Object#equals is also compares the type of instance
It's not likely that it will and even if it does, it's likely to remain anyways and just delegate to the new API (as was the case with the persistent data containers in 1.13 -> 1.14)
Generally you're fine to ignore deprecation warnings from draft api
Wth yes?
Generally you're fine to ignore deprecation warnings from draft api
Nice!!! Thank you so much
I just couldnt find a replacement for that event and took me ages to find it haha
Though we don’t need a value check which is what .equals() mainly is for
I've never heard of EntityPlaceEvent tbh
Me neither, and I was getting crazy because no event was being called when you placed armor stands or ender crystals
Oh I see. armor stands, boats, minecarts, and end crystals
Yeah
can anyone help me with my problem?
And I also needed to know which player placed them haha. Nice event
Whats the problem?
@rare prairie Would you maybe know another possible solution to my issue?
(The Grindstone one)
Did you built your project libraries?
as in, gradlew build or?
Yep
Dutch send your build.gradle
yep have done
That event was added in 1.13.2, xtomyserrax
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '5.0.0'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
version '1.1-BETA'
repositories {
jcenter()
mavenCentral()
maven {
url "https://hub.spigotmc.org/nexus/content/repositories/snapshots"
}
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
maven {
url "https://maven.enginehub.org/repo/"
}
maven {
name 'papermc'
url 'https://papermc.io/repo/repository/maven-public/'
}
}
dependencies {
//Spigot API
compileOnly 'org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT'
//Apache Commons
compile group: 'commons-io', name: 'commons-io', version: '2.6'
//WorldEdit API
compileOnly group: 'com.sk89q.worldedit', name: 'worldedit-bukkit', version: '7.1.0'
//PaperLib
compile "io.papermc:paperlib:1.0.4"
}
shadowJar {
relocate 'io.papermc.lib', 'nl.thedutchmc.uhcplus.paperlib'
}
It's likely not going anywhere
Or wait, does the inventory type exist in compile time but not in runtime?
Hope its OK to post these codeblocks in here
OK, will swap it out then
Or wait, does the inventory type exist in compile time but not in runtime?
@naive goblet @light geyser
It's likely not going anywhere
Nice then, thank you a lot Choco. Also for that tip about drafts
@naive goblet Eclipse tells me it doesnt exist, did not try compiling with it, will do now
Ill try compiling it, see if that works
Just check if you can use it in your ide lol
Yep compiling is OK, seems just a Javadoc issue theb?
Make sure your server is up to date
InventoryType.YOURTYPE
Oh it doesn’t exist in the api?
apparently
And you’re up to date?
using the latest one from the spigot repo, I think?
That’s weird
Was added in 1.14-pre5
Have you tried reloading your gradle project
Try to delete .m2 folder from Users folder and rebuild
Doesn’t matter
He isn’t using the local one anyways
Did you restart your ide as well?
And are you in the right project?
Yep to both
nope, correct class too
Hey guys - I have a strange issue that started with 1.16.1..things mobs/arrows lags out and skips around. No resource issues on a dedicated server and never saw this with the 1.15.2 builds
What if you close the class and reopen it
is it at all possible to create entirely new textures in minecraft if you get all players to download the pack or something?
I think so
Re opening class does not work. Will Try restarting IDE once more
Yep, used it just fine with the 1.15.2 api
Not trying to promote my stream here, but you can see it on there too how it is behaving
Ive run buildtools yep, just for the server jar though
Whats the method to create a JSON file? https://hastebin.com/jizavicigu.java i already have the save, load methods done and the path defined
Then use dependency org.spigotmc:spigot:1.16.1-R0.1-SNAPSHOT
And the mavenLocal repo
that would just be mavenLocal() ?
See if it exists then
@lapis plinth just creating a json file can be done with a File instance
thanks to my new phone it didnt save my spigotmc 2FA login so i have no way to get in my account Sentaku
Can you give me an example? Im really new to files in general
kk
Also only create if File#exists() is false
This is more of a storage thing rather than config
Yes
kk
Does it matter where I run build tools? or is that irrelevant? for mavenLocal
File file = new File(“./file.json”);
if (!file.exists()) {
file.getParentFile().mkdirs();
try {
file.createNewFile();
} catch (Throwable e) {
e.printStackTrace();
}
}```
Dutch it should be irrelevant
sweet, redoing BuildTools now, will let you know if its fixed afterwards
Yeah I assume you don’t run buildtools in some weird directory
On my A drive, basically next to my workspace dir 🙂
i really hope i dont have to make new account lol cuz i had alot of plugins on my original account 😩
Conclure, don't use Throwable in these situations, just use IOException by default generated, because Throwable catch all exceptions and errors, like LinkageError | SystemException
Huh
It was a pseudo code lol and for the record I’d be happy to catch all possible exceptions
Come with something relevant if you’re going to nitpick
big oof
Ok, but if that method does not contain that exception throws? Then it makes no sense
@tame drum login with your desktop computer change your account password, and login with your mobile
Brah, Don't use Throwable
@rare prairie okay ill try that
@rare prairie why not lol
Give me an actual solid argument why it shouldn’t be used
BUildTools>Extracting the Git stuff got really slow 🤔 jeez
why generalizing with Throwable, when the only throwable you need to catch is IOException
Catching Throwable is super bad
I’m on mobile and can’t remember what exceptions it throws
SirYwell that’s not an argument
Throwable includes Error
IOException extends Exception, which extends Throwable
But yeah it would only be necessary to catch IOE
So curious, is there any way to force apply an enchantment to an item?
okay I can link that too https://stackoverflow.com/questions/8728866/no-throw-virtualmachineerror-guarantees/8729011#8729011
Catch Exception if you want to generalize
Catch Exception if you want to generalize
please don't
ahah imagine doing error handling, C programming gang here
What is the name of 'glazed terracotta' on spigot?
@rare prairie it didn't work 2Fa still there:/
montlikadani that’s not specific but I get the point
This happens if you writing fast
@subtle blade if you have a method with a lot of exceptions being thrown just catch them all with Exception instead of Exc1 | Exc2 etc?
Or write proper methods that don't throw a dozen exceptions
Not my fault other methods throws a bunch of them
Catch Exception is one of the more unreadable things you can do
Catching Exception is still bad practice but not as critical as catching Throwable
Depends
I juat reset my password and it still needs 2fa code rip
True
^
You're also going to end up having logic errors you can't track down. If your code isn't working because your catch block is supressing an undeclared exception, you're in for a world of hurt
Do not catch Exception
^
Only reason why you’d avoid catching Exception is if you want to handle different exceptions differently
ehm no?
not really
So I can't re add 2fa info on my Google authentication cuz it needs key 🙃
I literally gave you 2 very good reasons not to catch Exception
Logic errors and readbility
I only use when using reflections
I can see the point of the first one but I wouldn’t certainly say it gives less readability but it depends I guess
even then you can catch ReflectiveOperationException
^
@rare prairie what can i do...?
honestly i'd rather not catch exception
Ive got a feeling its not normal for buildtools to be stuck here for at least 10 mins
@tame drum I don't know, ask spigot web devs
@naive goblet and how would I fetch string data inside of the .json file?
Catching ROE is much different than catching Exception. ROE was added for that very purpose - so you didn't have to catch 4 exceptions for reflective operations
Hmm okay I can try is it ok to ask them on here?
I have no way on spigotmc I cant post or message directly there cuz of 2fa locked me out
Thats why i had to come here to try find solution
How are you doing it currently?
@naive goblet I'm not doing it at all currently, thats y i need help with it xD
True Choco but I still think sometimes catching Exception is doable in the right context
@lapis plinth from that JsonObject you can get("property").getAsString()
oi hi zak
Hey.
Doesn’t spigot have a json lib?
Got bored of talking to JetBrains devs.
Lol
is there an event such as PlayerItemHolding that checks for when a player is holding a certain item?
I notice that Choco is the admin on forum maybe I can ask chocolate on here to try disable 2fa so I can login then reactivate so my stupid Google authentication can save it again?
Choco*
@tiny pebble I think else you might have to listen to packets
@subtle blade may i request your help on fixing my account so I can login and re-enable 2fa so my Google authentication can save it cuz when I transfer data from old phone for some reason it didn't save spigotmc code
@naive goblet would I have to define the path?
PlayerItemHeldEvent
Path of?
like plugins/pluginname/
nope
kk
Please use File.separator
It’s not necessary but it’s better
private final Path path = Paths.get("plugins/ValueCore/Data/"); Is this also fine? or do I haev to use Javaplugin#getDataFolder
@lone fog That seemed to refer to the last item being held. I wanted it to duplicate the diamond sword in my hand while i held it, and after I switched from it then it duplicated it (put in offhand)
just testing tbh but cant find the method
Use event.getNewSlot
File file = new File(pluginInstance.getDataFolder(), “config.json”);
Coll it doesn’t really matter at all
should I use json for my config files? 🤔
Yes pls
^

:kek:

getNewSlot() calls for an integer... still not it
should be the slot in which the player is holding the item, not a specific slot? whichever one the player is holding
Tanku what are you really trying todo