#help-archived
1 messages ยท Page 35 of 1
I want to make it storm more often, what would be the way to go? i was thinking of weatherChange event and then give it a chance to set it to storm?
@ocean hamlet if you use luckperms, toggle verbose on and execute the command you wish to
luckperms will send you all the perms the plugin checks
Does anyone tell me how to check if the player has the armor and the inventory empty? I've tried everything but I can't
for(ItemStack it : player.getInventory().getContents())
{
if(it != null)
}
for(ItemStack it : player.getarmorcontents())
{
if(it != null)
}
if(it !=null) {
e.setcancelled(true);
}
I tried this code already, but I can't
Does anyone know how to get all directions that a lever could be facing? I've tried using Switch and Directional, and they both work to the point that they will return NORTH, EAST, SOUTH, WEST when #getFacing() is called, but if the lever is on the top or bottom of a block it returns EAST. Is there another class I should be using to get the face?
Block leverBlock = leverLocation.getBlock();
Switch leverData = (Switch) leverBlock.getBlockData();
BlockFace face = leverData.getFacing();
values()?
?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.
sic my ass
Don't ask to ask, just ask ๐
can someone help me please!
well, post your problem
i love this guy
ok
I put world guard protection on the spawn, and I made crates, but players didn't have access to those crates.
Go to the EngineHub discord for world guard questions, you can probably get better help there
do you also allow interact in the region? @frigid ember
Hi, I have a little problem, I had a loop for but I had a java.util.ConcurrentModificationException in my console, so I used an iterator but I feel like I'm misusing it because I still have it, anyone have an idea?
you can't edit a list you're currently iterating over
shadow the list, iterate over that and remove from the original one
you need to use iterator.remove() instead
you can remove it from list if you remove it that way
but only the one being iterate over though
I mean.... idk I'm not good at explaining xD
oh yes now I remember
All right, I think I understand, that means the iterator will understand that I'm on the point since it doesn't ask for an argument.
there is the removeIf methods, which is likely much better for that specific case
Does anyone have a good tutorial for sending packets from a bungee plugin
But, using an iterator is basically the good ol' goto there
Yeah I did that, it was just to understand the iterator in the first place.
@ocean prism if you do iterator.remove() it will remove the current object that you just got from .next()
but if you just want to remove, removeIf probably cleaner
there are computing functions for lists like the removeIf function, they are lightly more efficient
๐ฎ
there is also the way of creating an imutable list loop from it and remove from main way i think ๐ค
should i report them here?
@iron ravine well copy a message link or screenshot and then ping one of the staff
there is also the way of creating an imutable list loop from it and remove from main way i think ๐ค
@tiny dagger I already said that it's the very old way
it's not that efficient really so better go with the other 2 way
removeIf theoretically should be more efficient than that I believe @tiny dagger
bah la fait pas mdr
So, it works but half lol, I certainly don't have ConcurrentModificationException anymore, I don't have console errors anymore but it doesn't do what I do, and when I make sure I don't have this basic error (i.e. wait) it does everything correctly
@cobalt thistle t'es un rigolo toi mdr
My code, i've iterator.remove();
then it's something from you side, add debug messages if you can't figure out
The problem is that nothing happens, the only change is that I don't have any console errors.
so you want to remove filestates that are not accepted right?
well it does that from my point of view
Yes, but, uh, maybe I'll give you a little context so you'll understand:
I do a RESTful api, which allows my program to retrieve internal json information from a url, roughly that's it, but before I had a simple loop in my method, and as soon as I asked to return the information during this manipulation, I had a ConcurrentModificationException in the console which canceled the method, so I used an iterator to fix it, problem being that when I call the method during the manipulation I don't get an error in the console but the method always cancels itself. @tiny dagger
(as in pm someone)
no, since this happened on discord, not on the forums. As far as I know, external issues are not handled.
@iron ravine as this is a legal issue, please feel free to contact the Discord(TM) trust and safety team at https://support.discordapp.com/hc/en-us/requests/new?ticket_form_id=360000029731
is there any auto update plugins out there?
so a plugin looking for other plugins updates?
Installer i guess
but that was very broken the last time I used it
crashed the server 99% of the time
cc
i am new in spigot
Im making a messaging system, that has like threads so you can do /reply [threadid] ok etc when you're offline
Like on the forums with the conversations, what is a good name to call it, a thread, conversation or what
please can you tell me some sites you are using to create server
so a plugin looking for other plugins updates?
@vale slate yes
there are a lot out there, but they are not what you would consider good or helpful
autoupdate is bad for production
ok
Hey, just out of interest how would I go about changing my name on the forums? Do I need to donate? If so, how much?
Would be great if y'all could ping me ๐
10 bucks minimum
Ah okay, are there any other perks of donating?
hey, i've been trying to understand why im getting this error on my plugin although couldnt get anything on it, can anyone help me?
error: ```java
15:48:38 [WARNING] Error enabling plugin BedMC
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at net.md_5.bungee.api.plugin.PluginManager.enablePlugin(PluginManager.java:328)
at net.md_5.bungee.api.plugin.PluginManager.loadPlugins(PluginManager.java:235)
at net.md_5.bungee.BungeeCord.start(BungeeCord.java:272)
at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)
at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
Caused by: java.lang.IllegalStateException: JavaPlugin requires org.bukkit.plugin.java.PluginClassLoader
at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:50)
at org.bedmc.bungee.BungeeMain.<init>(BungeeMain.java:5)
... 9 more
Bungee just keeps giving me this error and never initializes the plugin.
Caused by: java.lang.IllegalStateException: JavaPlugin requires org.bukkit.plugin.java.PluginClassLoader
at org.bukkit.plugin.java.JavaPlugin.<init>
i think this is straight forward
yeah i read that although i tried importing pluginclassloader although i get this
don't import bukkit into main class of bungee plugins to begin with
oh
sorry im still new at this if im doing alot of basic mistakes ๐
so where do I import it?
you dont import it because its a bungee plugin
oh, yeah im watching one, although he never mentioned anything about classloader
hm
https://www.spigotmc.org/wiki/create-your-first-bungeecord-plugin-proxy-spigotmc/ would this page help me?
wait sorry wrong page
blic class TestPlugin extends Plugin {
import net.md_5.bungee.api.plugin.Plugin;
@Override
public void onEnable() {
// You should not put an enable message in your plugin.
// BungeeCord already does so
getLogger().info("Yay! It loads!");
}
this is the main thing
there is nothing more to it
well from here is to make what you proposed
oh alrighty, thanks! Sorry for the simple mistake just a bit confused with the bungee api
help
Hello ๐
mob.setSpawnedType(EntityType.ZOMBIE); do i have to do switch or enum, or list to check args?
@rotund fulcrum https://minecraftitemids.com/types/music-disc use item id's for the music discs.
https://www.spigotmc.org/threads/play-minecraft-music-in-worldguard-regions-1-15-2.432811/, can anyone help me with this please? ๐
How come Bukkit.broadcastMessage(event.getItem().getType().toString()); is broadcasting SUGAR_CANE_BLOCK when I'm using 1.15 holding sugar cane
SUGAR_CANE_BLOCK shouldn't exist, right?
ah, it was to do with not setting api-version: 1.15 in plugin.yml ... nevermind
anyone can help me with regards to the question i asked earlier?
mob.setSpawnedType(EntityType.ZOMBIE); do i have to do switch or enum, or list to check args?
@unreal hedge
I don't understand your question @restive shard
oh
Quick one, https://papermc.io/javadocs/paper/1.12/org/bukkit/inventory/Inventory.html#containsAtLeast-org.bukkit.inventory.ItemStack-int- (can't find a Spigot 1.12 javadoc)
#containsAtLeast(ItemStack item, int amount)
returns false if item is null, true if amount less than 1, true if enough ItemStacks were found to add to the given amount
Is this supposed to say returns false if item is null, false if amount less than 1, true if enough itemstacks were found to add to the given amount?
Because if it returns true when amount is less than one, I'd need to check the amount anyway. Just confused.
Checks if the inventory contains ItemStacks matching the given ItemStack whose amounts sum to at least the minimum amount specified. is the updated javadoc one
in spigot 1.15
what i mean is, i want to do
/spawner (args)
i would need to open a if else statement to check for every mob in minecraft. i.e. (EntityType.CREEPER, EntityType.ZOMBIE)
is there any easier way?
Hey, Is it possible to create a command that if it already exists does not replace it?
use EntityType.valueOf(STRING) @restive shard
Hey, Is it possible to create a command that if it already exists does not replace it?
@ocean prism it's possible, personally am not sure how, but essentials has (or used to have) a config option to enable their cmds to override or not override other commands
ty @dusty topaz appreciate it
@ocean prism getServer().getPluginCommand("");
Will be null if command isn't registered
Make sure your plugin loads after the rest though I think? ^
I think I misspoke what I want ๐
if (getServer().getPluginCommand("test") == null) {
getCommand("test").setExecutor(new TestCommand());
}
Is this what you want?
I want to make a help command, but it already exists by bukkit, I would like that if I create a help command, the ones that bukkit does run but my command does as well
Listen on the CommandPreProcess event and check if the message is /help (or whatever) and then run yours
Yes nice
but don't cancel the event and the server will run the other one too
okok thanks u ๐
Is there an event called for when sugar cane breaks on its own?
I'm trying to allow for sugar cane to be grown on something like obsidian
I can place it down using this:
@EventHandler
public void onInteract(PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR) {
if (event.getItem() != null && event.getBlockFace() == BlockFace.UP) {
if (event.getClickedBlock() != null && event.getClickedBlock().getType() == Material.OBSIDIAN) {
if (event.getItem().getType() == Material.SUGAR_CANE || event.getItem().getType() == Material.CACTUS)
event.getClickedBlock().getLocation().getBlock().getRelative(BlockFace.UP).setType(event.getItem().getType());
}
}
}
}
But neither BlockPhysicsEvent or BlockFromToEvent call when it spontaneously breaks
I dont think you can prevent it
What you could do (this might be a little hacky) is send a packet to make the client think theyre placing it on obsidian but the real block is sand
Hello, why I don't have my plugins in my purchased resources? anyone to help me
@nova mantle contact support on forum
@nova mantle Contact the author of the plugin you purchased in Spigot messages
mhmm best way to save an object containing loc,type,level,level? Atm can't think anything else but in 1 config alone
it's a custom block so it iwll always be loaded
trying to host 1.8.8 but whenever i try to open the server.jar it doesn't show up
the window never comes open
help
how you open it?
you dont..
i have java
what?
everyone else just opens it from File Explorer
ยฏ_(ใ)_/ยฏ
we dont..
don't double click it
place this into notepad then save as start.bat
???????????????????///
you need to run it from command prompt or some other command line
doesnt matter
ok
it will give you the optino to save as.. and manually type start.bat
also change Xmx based on how much ram you wish to allocate
@vernal spruce store in a data file or database with the location coords as the primary key.
thats the thing im already doing it
i avoid database to let everyone use it
even if they dont have sql
Generally people give support for both, it just depends really
^
Like are people going to need that block information on other servers in the same network, or information to show on a website?
Prolly not in your case
So go ahead, make it flatfile
yeah its not per player or anything so i can't make a custom config for each..
i mean i could but i dont see why..
Yeah, just a data file will do
if you don't need it human readable, suggest going with memory mapped files
Even considering they'll always be loaded when the server is online, you'd have to account for restarts therefore saving it. I can't really think of any other ways of saving that data
As for the type, level and level, is there a way you can just work that out based on the time the object was placed?
It'd be much less resource consuming storing the time and location and not having them loaded in memory
Instead, calling upon them when needed.
Well I guess it depends, idk the context well enough
theyr loaded into memory as theyr gonna each do something
Yeah fair enough
so i have a "lava crucible" from one of em modded packs
meaning it has to stay loaded so the loop transforms its "contents"
I was just thinking if you had like millions of entries, defs don't store in memory lmao
But yeah I get ya
nah at most like 100-200
Alright, nice
memory mapped files will do you justice in this instance. Memory mapped files are separate from the JVM therefore doesn't have any impact on the application. Also, you allow the OS to handle write and reads which is faster. If the server crashes the OS will handle saving the file. Also memory mapped files can be shared between processes as well.
question, i wanna give a little chance to gain a bit of hunger in hit. how is that made?
EntityDamageByEntityEvent & Math.random() * 100
All I'm gonna say @soft fable you should be able to work out the rest :3
you also don't have to load the entire file into memory either you could optionally just load parts of it at a time
ok thanks!
If you want to account for arrows, snowballs etc, then that's on you
but if you are only going to have like 100-200 lines of entries, at most you are looking 10mb of ram being used on it
it's usually loaded at the start of the server where there is no activity
I guess that event would work for those instances as well, if it doesn't matter who the shooter was
the only downside of memory mapped files is that you need to determine ahead of time how much ram to allocate to the file
can't change it afterwards without unloading it and then re-loading it back into ram
ouch..
but, 100mb of ram will be plenty though
and in todays age of ram, 100mb is nothing XD
Can't you make them invisible noAI entities
And let the jar handle the rest? ๐
People would also be interacting with entities less than they would be with blocks.
hello??
G'day
hmm it could work
but at that point the ideea why even bother with entities do it packet based gets around..
I have an object that is storing lots of items.
I have a GUI that uses those items and builds an inventory, like a chest players can take items out of that inventory.
Do I need to handle the item takes and entries using InventoryClickEvent to update the items in the object according to amount taken etc... ?
Because I tried that and it didn't work and was hell
i can do it through packets but theyr so annoying to work
So I am guessing with your lava crucible, you listen for players to drop their items into the lava?
it opens a gui wich they can interact with
I'll be doing something similar eventually, with Greek deity themed shrines, to replace crates.
showing lava level,cobble level.. heat source under
The word crates just sickens me now, overused and unoriginal
Oh okay
That makes sense
it tries to be immersive without using a texture pack..
You could have an NPC that's called "The Blacksmith" lol, or an invisible entity and wait for it to be interacted with
already did a plugin spawning a fake player wich gave quests so it wouldnt be that hard
dem packets..
@fleet burrow Are you trying to do something similar to PlayerVaults?
all that work just to avoid having dependencies
playvaults in theory seems quite easy to pull off,ur just reading/writing a players own file..
Well it's worth it, you can let Spigot handle the storage/loading of the data (the entities), all you need to do is listen for interactions for that particular entitiy's UUID
Ikr, I haven't looked into those infamous duplication glitches associated with it though
Something about using it while standing on a lilypad? ๐
it shouldn't matter depending on how you save it..
@fleet burrow Are you trying to do something similar to PlayerVaults?
@unreal hedge not really but in theory, yes
i save my guis storage on closeevent,setting them all null then getting each slot and saving it..
but theyr not often changed(rewards for things)
well
@fleet burrow go more in depth
List<PlayerFuel> fuelsWithEnoughEnergy = machine.getFuels().stream().filter(fuel -> fuel.getEnergy() >= machine.getFuelDeficiency()).collect(Collectors.toList());
Does this give me a clone?
if I do fuelsWithEnoughEnergy.get(0).setEnergy(something)
Will it change it here machine.getFuels() ?
Pretty sure it should clone
It's a new list yeah @fleet burrow
Test it ๐ If not, then you've learnt it doesn't and to just simply use .clone()
If it isn't clonnable, try to make it clonnable
It will be kind of hard to test that
no it won't
Arvo, you tried making a modular project before?
modular projects are fun
I've considered using Spring before, not too sure where to start with my minigame framework that I'd like to make.
The reason why I want to make it modular, is at this stage I'm just guessing what I'd reuse with the first minigame I'm making on my network.
There'll likely be much more I'll need to add to the framework in future.
it's a reference in both cases
how can i test if a blockdata represents a tilestate?
the list is a clone but the inner vallues are not
which makes sense when I think about it now
Does anyone have a suggestion on how to uniquely identify a server?
Like I am saving data to a shared database for a server cluster, but some of that data is server-specific. Where could I get an id or tag of some kind to differentiate servers? Does such a thing exist?
(short of forcing users to put an id in a config file)
Well by "server" i really mean "server instance"
oh yeah but port+IP could work
(they may be running on the same physical machine)
Mhm x)
though it'd be a shame to lose data if an admin wants to re-arrange internal ports (e.g. behind Bungee) ๐คทโโ๏ธ
Is it more relevant for the IP address/port they use to connect?
Or for every single server instance on a bungee network for instance?
Well I think most often that's all transparent- yeah every instance on a network
Just do that, save backups regularly.
Basically think of something like LogBlock but working across multiple servers at once
I'd prefer something independent of any sort of server config (like port#) but I don't think such a thing exists
I was considering using the UUID of the default world...
You could do what Votifier does ๐คทโโ๏ธ
Which is.. ? ๐
Private token and a public token, get the server owner to verify each instance.
ah yeah
Even if they change their port, you still have that same instance.
Mhmm, that could work but I'd prefer zero admin interaction (I know, I'm being a pain lol)
Only way for that to occur is the IP/ports and save regular backups
If they change their port of their server, that could be an issue
But at least you'd have backups if they contact support lol
how can i test if a blockdata represents a tilestate?
yeah- the backups dont' super help, if they change the port then I need some way to fixup all the data
heh .. yeah
Hm well it occurs to me the data is really per-server/world .. so maybe I just switch to world uuids
Wouldn't hurt ๐
But what if someone purposely tries flooding your database with fake world UUIDs?
I mean no one but a server admin would have access like that
man.. just finished with creating a gui based of holders,and it's so nice
if they want to crash their own db, by all means ๐
Oh, it's just their database lmao, my mind just had diarrhea for a second.
so i wasted an entire night trying to figure out why my spigit minecraft server wasn't working right
is it really cause it doesn't support bedrock clients connecting to it?
are you expecting a c+ based client to connect to a java server?
or i'm just an idiot?
Spigot servers don't support bedrock clients I believe
yeah, i didn't relize spigot was java haha
we have no crossplay yet(unless screwing with things)
atleast i figured it out before i spent all day today troubleshooting it
and also bedrock has pretty much no modding..
Bedrock to java edition is like apple to samsung
yeah, i know ๐ฆ but i have a 5 year old that plays xbox minecraft i want to have his older siblings and myself play on pc
heard client runs smooth af,but bedrock server has shite performance..
so i'm forced into cross platform.
yeah, i had one setup, but then i was looking for mods and came across spigot, installed that in the same folder... and yeah, been wondering why i couldn't connect to it ever since till this morning.
Yea
beside the usual spigot,forge is not working on bedrock to have modpacks..
sigh, i seen some youtube videos on how to mod it, but it requires making all the files urself after executing the mods on a local client.
so no more cool things
very tedious. lol
and not rly worth bothering i think... better to stick to vanilla..
anyone know why I'm getting this? :https://hastebin.com/katazowame.cs
(I'm running a bungee cord network fyi)
is there really no way to know if an item has no more durability?
without hardcoding the durability
Why not hook up another monitor or connect remotely to the TV with a virtual PC
Then let your son connect his xbox controller into your pc
Then you both technically have a computer you can use for Java edition servers ๐
@slim hemlock doesnt the new damageable let you know?
you have get has and set
there is no "max"
and you can't rely on it hitting 0 because it counts up, not down
so I'm at a bit of a loss
for(ItemStack it : player.getInventory().getContents())
{
if(it != null)
}
for(ItemStack it : player.getarmorcontents())
{
if(it != null)
}
if(it !=null) {
e.setcancelled(true);
}
not work, why?
why is Damageable so weird
@vernal spruce I don't want to listen to when something breaks, I want to apply custom damage and know when it's supposed to break in vanilla terms
because rn you can just keep piling it on forever
setting custom damage will never break the item
The only way an item would exist with no durability, is if you spawn it in.
Otherwise, it'll break as per server functions
well it can depend on how you wish to do it
what I mean is that you can set your item to have whatever durability you want
minecraft will never break it when you set it
a work around is setting the item unbreakable then storing durability inside
but I want to break it
So are you suggesting no matter what you set the durability to, the item will not break no matter how long you use it for?
it's for a deathchest plugin, I want to apply a custom durability loss as a death penalty and then put the items in the chest if they still have any durability left
right now there's a bug because players have fun just dying over and over again to see the durability bar break
it will keep going into the negatives till it's offscreen
๐
Yeah, if it's negative maybe lol
You could also set a minimum durability
the layout its strange doesnt point to something in particular
maximum major
So assure it won't lose anymore durability after that point, otherwise bye bye item
but yeah I was considering that as a last resort
bit problematic because people might be using swords with dur X
Deprecated. durability is now part of ItemMeta. To avoid confusion and misuse, getItemMeta(), setItemMeta(ItemMeta) and Damageable.setDamage(int) should be used instead.
So you're setting its damage, not its durability
So yeah, I get ya
Given that each item has a different durability, you could also look at adding a % to the damage instead
glad to see I'm not the only one having a hard time getting the details of this subsystem straight
wouldnt going into nms with nbttag provide the maximum item durability?
Well what you should have done is check the class https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/ItemStack.html and see what methods there are.
See why it's deprecated there as well, then you quickly realize (as I did) you are setting the damage instead.
actually hang on
the docs say this returns the max durability for the material
that won't fly
it doesn't take enchants into account
i think ur over complicating things for not that big of a thing..
All the enchantments do, is give the item less damage every time it is used.
oh it doesn't increase actual durability?
Correct
oh I see
So what is your goal? Do you want to add a particular amount of damage to all items globally? Add a % of damage to all items globally? Or add damage that is equal to uses?
Like damage that is equal to 15 uses
that's actually interesting, the implementation of enchants in mc looks like it was conceived by a raving lunatic
Because that damage amount will be different, even for the same materials if they have unbreaking.
How do I check what kind of spawner it is?
https://minecraft.gamepedia.com/Unbreaking @slim hemlock
It's up to you, if you want to take Unbreaking into account
@old barn cast the state to CreatureSpawner then do getMobType or something similar
ok sanity check I can't be the only one questioning why durability loss is based on chance instead of on fixed values right?
Get block at line of sight (unless you have it via the coords or whatever), get state, check if it's a CreatuerSpawner, check class for methods https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/CreatureSpawner.html
You can see that it is a superclass of BlockState*
for(ItemStack it : player.getInventory().getContents())
{
if(it != null)
}
for(ItemStack it : player.getarmorcontents())
{
if(it != null)
}
if(it !=null) {
e.setcancelled(true);
}
not work, why?
Oh, you want to get the spawner type in the inventory lol
no
ur doing nothing with that check
I want to check that the player's inventory and armor is empty
Quick question, I'm a noob here so sorry for the dumbness, my enable-query is set to false, yet I can still see it at mcsrvr.
I restarted the server.
Is this behaviour wrong?
if(firstEmpty() != -1){ return;
for(ItemStack item : inv.getArmorContents()){
if(item.getType != Material.AIR) return;
}}
boom, no armor and empty inventory
Yeah I was lazy okay
Shush
If ima spoon feed, that's what you get
dirty spoon feed,shameless๐
if (firstempty() != -1) it works?
Oh wait
My bad nuh
That wouldn't work
My brain go poo poo
Oh yeah it would work lol
So what that means, is if there is no empty slot
It will return -1
As for armor, the list won't be empty, it'll just contain air, an armor of air! ๐ฎ so yeah, if any of the armor isn't air then also return
Hmmmm so we used to have Server.getServerId() - where did it go and why did it go away?
@deprecated not a standard server property
ah, well
That would've worked perfectly for me ๐
Hey so when a player dies, it has this component in the death message. Does anyone know how to get that component from a player? https://imgur.com/a/fZz3sp3
@wicked atlas what do you mean? From a player when they type a normal message?
no I want it from a Player object
because I'm making a custom death message-ish thing
and want it to behave the same
So you want to be able to print out a custom message with the same hover effect?
Ah, one moment...
yes
yes those
Then read that wiki and you're sorted ๐
I was hoping I can get the one in the death messages from a player
rather than making it manually
nop
does anyone know how to get a player's team/team's color?
scoreboard?
Isnโt there a cmd for it?
I think he is wanting it in a plugin though
yeah
Or accessible with scoreboardmanager then
^
I'm just reconstructing that component manually
that is how it was likely done initially
Use the server instance to obtain the ScoreboardManager then get the scoreboard wanted and call Scoreboard#getTeams
There is probably a method to get a specific Team
Check the docs
Am I being stupid or is this wrong
@fleet burrow You break in the original if statement, so the if(found) is always false.
but i am setting found in the if
notice that in the only codepath where found is set to true, you break
oh im stupid
You don't need the found variable at all. You're already breaking.
lol
i don't think if this is a good example
but does it do that for this too? ๐ค
because it attracts bugs
Yes, same situation, fr33
no but seriously, you don't get eye strain like at all
so uh
im getting thousands of
[13:23:39] [Server thread/WARN]: Ignoring unknown attribute 'forge.swimSpeed'
flooding my console
flooding
so uh
what do i do?
i need help with port forwarding so i have an ip for my server
[13:23:39] [Server thread/WARN]: Ignoring unknown attribute 'forge.swimSpeed'
Is it a Forge server? Or was it at one point a Forge server?
how to apply my script placeholderapi, into my gui code ?
i need help with port forwarding so i have an ip for my server
@rotund fulcrum
This is bungeecord
I keep getting a NPE when trying to send a packet via bungee
This code is triggered via a test command
PlayerListItem pli = new PlayerListItem();
pli.setAction(Action.ADD_PLAYER);
PlayerListItem.Item item = new PlayerListItem.Item();
String[][] properties = null;
item.setPing(0);
item.setUuid(UUID.randomUUID());
item.setUsername("Test");
item.setGamemode(0);
item.setProperties(properties);
pli.setItems(new PlayerListItem.Item[] {item});
p.unsafe().sendPacket(pli);
return;
This is the NPE (it's long): https://pastebin.com/ZCTuePx8
@rotund fulcrum port forwarding depends entirely on your modem/router so we can't really help you
@zenith siren We can't tell which line number each line is.
Which line is line 87?
Oh yeah you right
get verified
Does anyone here have a good tutorial for bukkit async tasking?
@zenith siren i think its comming from the properties
cause line 87 in PlayerListItem use
DefinedPacket.writeVarInt( item.properties.length, buf );
@zenith siren i think its comming from the properties
@upbeat wyvern
Is there a way to get valid properties, maybe from the player
I tried myself something from some source of tutorials for bukkit async, but it didnt work very well and i think i did not fully get it
I need help on port forwarding. I use a Ubee router. It looks different than everyone elses. If someone recognizes or could help me with this, it would be greatly appreciated.
ok I'm so confused. I try to broadcast a component, but the server crashes and claims that the method doesn't exist https://hasteb.in/gofukehu.rb
but it clearly does exist, otherwise I couldn't have compiled it
Can i have help for so i can turn the compass into a go to place if you get me
@rotund fulcrum its pretty self explanatory
Hey, do someone is good at spigot MODDING ? not Plugin but modding
@zenith siren
Your local ip is what you find doing ipconfig
Start & end port is the same, 25565 i assume
Protocol is the only tricky one, use Both if you have it, but TCP is fine
And fhen set enabled to on
Bruh, I have no idea what you're talking about
๐คค
This is what I am confused about; my router's website thingy looks different making every single other tutorial on the internet obsolete
Sometimes their router has more options or less.
Making it simpler or harder for them
But I will look harder
@frigid ember, that was in bungee and not spigot but it is net.md_5.bungee.protocol.packet.PlayerListItem
@wanton delta Under what category is it in ipconfig?
There are multiple with multiple IPv4 and IPv6.
'Ethernet adapter Ethernet' doesn't show anything
below it
๐ฆ
OHHH I don't have an Ethernet adapter hooked up.
@frigid ember have you pre-loaded your world? It could be users going into new chunks
@rotund fulcrum use ipconfig /all
@rotund fulcrum its gonna be your iPv4 address
Make sure you choose the one you use
For example i have both wifi and ethernet on my pc
im not close to my router
i don't have a giant ethernet cable
i can move?
do you want me to move?
then again, i am using a laptop that has good specs
laptops don't have ethernet
get a giant ethernet cable then
laptops don't have ethernet
@rotund fulcrum
I mean a lot of them do
It doesn't really matter if this is a server for friends or smth similar
How many people do you plan to host?
oh, i am planning on releasing this off of my factions server
which is going to be a skyblock
so first day we'll have like 15 players?
idk
Okay then you should use an ethernet cable
unless you have good internet, it is going to lag like crazy
Your server will probably struggle to keep up on wifi
should i just get as close as possible to my router?
so the connection is closer?
That really wont make a difference in the large scheme of things
tru
It will struggle no matter what, due to self hosting
I'm not sure, mine is set up so that it transmits both and is in the SSID
Okay, 5ghz is good, it's faster than 2.4. Although that means the range is worse
So you will have to be close-ish to the router
let me go reconnect, be back in a sec
Your laptop is probably not even good enough for a server tbh
???
Laptop specs
what
geforce experience
graphics cards dont affect server performance
i go there to update drivers & stuff
ok
Theres also computer -> properties but whatever floats your boat
I'm not talking about clock speed or anything like that
It's the wifi transmission frequency, done by your router
GeForce GTX 1060 with Max-Q design
you don't care about driver
Intel Core i5-8300H CPU @ 2.30GHz
15.8 GB RAM
1920 x 1080, 60Hz
oof
driver is important, I was just talking about wifi earlier
We have no clue what that means
oh wait no thats not what i meant lol
So you're going to be running the server on this laptop... whilst playing too?
sometimes moderating
You should overclock to 4.00Ghz if your fan can handle it
not really playing
that's not really the best idea (playing and hosting)
overclock? hmmmmm my brother said he tried to but it wouldn't let him...
Well
well it is a H CPU
Says here u can
not a K
@wanton delta where 2 go to try 2 overclock
oh damn it laptop
where 2 do
lol ok
ice water bath lmao
you can't overclock it you just can fix it to 4GHz
and this is turbo and should not be done on laptops
well idk how to
it's still not good to run a server on a laptop for obvious reasons
Not a great idea
๐
Never a good idea to run a production server on home wifi too
I did that, it is possible
Wayyy to vulnerable
well idk
Mine are running in another network, should be fine
so should i or should i not
2 questions;
Should I?
Can I?
Should you? probably not. Can you? yes
Can you? Sure
Should you? No. Makes u vulnerable to DDoS, laptops arent great for server hosting
Laptop might go to sleep
and they are energy consuming as heck, due to non managed PSUs
ya
I mean sleep can be disabled
not to mention, laptop hardware is not built for 24/7 use
^
mart you can disable that too lol
^
but still
Ive never been able to with my laptop
the point stands
Or any laptop
Oh u know what im thinkin of video output
I was neber able to connect monitors to a laptop closed
Only if I had a desktop ๐ฆ
Does anyone know how to fix this filezilla error? (sFTP server works fine, the problem is my client)
Status: Waiting to retry...
Status: Connecting to ip...
Response: fzSftp started, protocol_version=8
Command: open "user@ip" 22
Error: Could not connect to server
sftp uses ssh port
oh really?
yes
try port 21
is it true that i just deltye the world file to get a brand new seed
yes
ok
@gilded forge not working
change the sftp port to something else like 21 because ssh may be binding to it before the sftp server can
sftp is ssh file transfer protocol, it is supposed to use the same port as ssh
because filezilla is easier to use
I mean, if the connection is lost I can just reconnect and I will be in the last directory I was
not available for linux :/
no as a client
as server?
how to import net.minecraft.server.v1_15_R1 ??
what is your client OS
@gilded forge linux mint
( pls ping me pls, fucking really )
Depend on the server, not the API
how to
import net.minecraft.server.v1_15_R1??
@frigid ember add the spigot jar to dependencies as the maven repo does not have NMS
@rugged dirge Pick one you like:
https://alternativeto.net/software/filezilla/?license=free&platform=linux
thx
When you run BuildTools, it will be installed in your local Maven repository
If you're using maven, artifact id should be just "spigot" (or "craftbukkit" if you depend on it instead)
how do you run build tools with a snapshot
You don't
but how do some plugins like mcmmo support netherite
They don't?
@rugged dirge Pick one you like:
https://alternativeto.net/software/filezilla/?license=free&platform=linux
@gilded forge thanks but all of them are file managers
anyways, there are no public snapshot builds I am aware of
For CraftBukkit, no
There never have been
Pre-releases are generally the only pre-update releases Spigot does
Even then they're far-and-few between, unstable and not recommended for production
imagine making a plugin for a snapshot so it breaks with the next snapshot
How long does it normally take for spigot to update after a full release?
<1 month normally
I know IP spoofing is really difficult to do, but if someone were able to do it they would be able to bypass the BungeeCord firewall configuration correct? If so, is there any way to prevent this? I'm not really worried about it but I was wondering how large servers like Hypixel prevent such attack? Because there will obviously be people willing to spend a lot of time trying to hack such server.
well use a second proxy
Just as a general note, unless you are actively having this issue, don't address it. It's not a necessity for newer or smaller servers
I'm guessing you would do that to prevent people from seeing your BungeeCord IP?
EDIT: I do understand that this isn't the biggest problem but we're not going to solve it by not talking about it. This could cause major issue's so waiting for it to become a problem sounds pretty risky. But thats just my opinion...
Anyone know of any good references (or maybe an open source library) for reading the "Sponge schematic" format?
I'm told it's the new hotness
Anyone know how to configure the qualifier name in the configuration.properties in spring? https://gyazo.com/f25de001a2efba60a756a2b9dac03c0d
@tame hull you could make something such as a temporary lobby with nothing where users must go through the website first with the same IP before they actually join, then store the results in a database temporarily and on every join event for the subservers check if they're clear to go with the data from the database
Hi, i have problem with the instalation of plugins from Spigot in my Aternos Server
@tame hull hold on, you mean real firewall like iptables? or you mean some IP limit plugin?
Today i wanted to install Luck Perms and Block Locker to my server Aternos, anda then, when i go to the Files, there wasnt any carpet
๐ค
Hey, how do I set a variable to a type of block, ex. a quartz block
The is a carpet when you finish to install the plugins
bruh
That just raised more questions than it asked
And then you can config the plugin after open the server
I think you've got carpets in your head
@mossy crane context, you mean in proper Java plugin right?
It's Material enum
thanks
(Block#setType())
breh, he want to store block type
@obtuse rose Later, I'm gonna come back to you to tell me if my code is shit
oh lol. Misread the first bit of that sentence
if anyone can walk me through port forwarding, i'd like to try and host a server, most of these tutorials are dumb and don't work, thanks
and how do I specify what block I want?
?portforward
?portforward
There's a command for this I swear
?
?????????
can someone help me :'c the problem only appears when i try to install Spigot plugins
๐
@rotund fulcrum is it for serious server or for fun?
serious server
?pf
THERE IT IS
for serious server, I would not recommend hosting on your own computer/network
I only dropped my Jedi weapon twice before picking it up the third time
@tame hull you could make something such as a temporary lobby with nothing where users must go through the website first with the same IP before they actually join, then store the results in a database temporarily and on every join event for the subservers check if they're clear to go with the data from the database
@arctic cloud That could work. I don't need a solution right now though, but I was wondering if there was any better way to do it.
@tame hull what do you mean by bypass firewall? I think there might be a big misunderstanding here xD
@obtuse rose How would I specify what block I want?
@tame hull hold on, you mean real firewall like iptables? or you mean some IP limit plugin?
@obtuse rose Both could be bypassed using IP spoofing. Its really hard to do though.
Lets move to another channel btw, so we don't create a mess here
could you bypass iptables with ip spoofing in TCP level? yes you can
will it "work"? no because you can only send information, but you won't receive response (unless you're that IP, which then it's not IP spoofing)
TL;DR; Handshake process will fail
@EventHandler
public void onBlockPlace(BlockPlaceEvent e) {
Player p = e.getPlayer();
Block b = e.getBlockPlaced();
Material q = Material.QUARTZ_BLOCK;
if(!b.equals(q)){
return;
}
Tell me if this is dogshit
wut
you're trying to compare Block to Material
^
you can do
// Do stuff
}
If you comparing more than 1 Material consider using switch
But formatted corrected
nop, just need to see if the block is quartz
then I'm spawning falling sand until it hits the quartz block
Should be ez
Why is this throwing an NPE? (return (R))
The field isn't null..
[23:24:24] [Server thread/INFO]: aadsada
[23:24:24] [Server thread/INFO]: private final java.util.Map org.bukkit.craftbukkit.v1_15_R1.inventory.CraftMetaItem.unhandledTags
[23:24:24] [Server thread/INFO]: unhandledTags```
Note: this is work because Material is enum, don't compare string or any object with ==
^
Enums are constants (:
oke
Enum elements are constants
@fleet burrow which line?
the return (R)
Itโs yellow marked innit?
yup
What does it say :o
is it possible fieldName doesnt resolve to a field
that should fail at setAccessible though? @fading owl
truth
show the stacktrace
lmao Conclure
Location loc1 = b.getLocation();
loc1.subtract(0, 1, 0);
or just add supress comment thingy?
or annotation up to you xD
Would this work?
hmmmm... ๐ค
but that's not the problem lmao
@mossy crane pretty sure it would
i think i got the wrong guide or an outdated guide
random chimp event
^
Hey @subtle blade i dm you
in a code block
Caused by: java.lang.NullPointerException
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:57) ~[?:1.8.0_221]
at sun.reflect.UnsafeQualifiedObjectFieldAccessorImpl.get(UnsafeQualifiedObjectFieldAccessorImpl.java:38) ~[?:1.8.0_221]
at java.lang.reflect.Field.get(Field.java:393) ~[?:1.8.0_221]
at me.oriharel.machinery.utilities.ReflectionUtils$Fields.getFieldValueOfUnknownClass(ReflectionUtils.java:86) ~[?:?]
at me.oriharel.machinery.utilities.NMS.getItemStackUnhandledNBT(NMS.java:83) ~[?:?]
at me.oriharel.machinery.inventory.Listeners.onInventoryCloseHandleFuels(Listeners.java:69) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_221]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_221]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_221]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315) ~[spigot-1.15.2.jar:git-Spigot-e7dc2f5-ce66f69]
... 18 more```
@rotund fulcrum maybe try other more common program if there's any out there ( I haven't try any UPnP stuff)
The thing that allowed you to port forward without router admin access is called UPnP (Universal Plug and Play)
Oke
is there a guide for specifically UPnP Minecraft port forwarding
beacon looks the easiest
FieldAccessor reference is null
Hello. Our server is on 1 core. TPS drops when loading chunks in the under world (map is not loaded). Will there be a difference in server performance if you connect a second core?
@wet compass which server software?
Didn't understand the question a little bit
heknon debug the field name
Hello, have a question with plugin mycommand (Dynamic icon menu), who knows how to make colored glass pane <next> another colored glass pane ?
step through it
@wet compass spigot? Paper? Other?
What is your CPU usage when TPS dropped?
@wet compass spigot? Paper? Other?
What is your CPU usage when TPS dropped?
@obtuse rose paper, cpu usage 100%
Hey, how would I spawn the falling sand entity?
K get more core xD @wet compass
Can adding a second core?
K get more core xD @wet compass
@obtuse rose
@wet compass that should help yea
Hello! Sorry to interrupt. Just looking at https://www.spigotmc.org/wiki/creating-a-gui-inventory/
How would I access the inventory & register it as an events listener? Create an instance in my main class, and use that as a getter & register it there too? Tyvm!
@wet compass that should help yea
@obtuse rose
That is, Java already supports several cores, and not as before one?
Java itself support mult-threading
Minecraft do most stuff on main thread. (Except networking) But for paper, it does load chunk with multiple threads I believe
Well mc is tickbased
@obtuse rose I have 2 questions but they're gonna get drowned out can I DM you?
Does anyone have a good MongoDB Tutorial? For just creating a user database to store tokens, rank, and such?
@mossy crane I think ideally spawn falling block would be the best option, but I haven't done that for ages and have forgot how to do it ๐
I got that
- How do I make a "loop" that goes back to a certain point
- how do I make a VERY small delay
I'm not quite understand both questions
For 2 what are you trying to delay though
@mossy crane
is there a way to make the bounding box of an arrow nonexistant via packets?
The block placing
So, I place the sand block
I want to give it a little bit of time to fall before placing another sand block in the same place
you can schedule a task
runtasklater?
just schedule a task
Yea runtasklater
How do I do that
nice
?jd
daoufnas
thx
thats not intuitive
yea
?jd BukkitRunnable
nice try
Bukit.getScheduler()
Start reading doc from there
Many useful stuff you should know about scheduler
anyone? ๐ข
@turbid musk ?
Does anyone have a good MongoDB Tutorial? For just creating a user database to store tokens, rank, and such?
I haven't been able to find a sufficient tutorial aside from the MongoDB Docs and one on the wiki page.
well mongodb is not a sql database
mongo does not have tables but have "collections"
@obtuse rose How do I amke an if statement a task?
a nice thing about using sql is that the JDBC drivers for MySQL and SQLite are shaded into the server
so you don't need to shade more dependencies
well @turbid musk - you understand no-sql and you only want a tutorial to explain you how to interract with mongodb in java ?
@mossy crane wrap it in a runnable then schedule it via scheduler, or wrap in BukkitRunnable.
You should read the doc, there's many option you can choose from
the docs are shit
Spigot doc is quite nice tbh
I have a very light understanding of it @upbeat wyvern. I've messed with the Firebase Collection system prior to looking into MongoDB. Since they're both NoSQL Databases.
@young dawn first one have ECC memory, I would say the first one
@turbid musk heave you red that https://www.mongodb.com/blog/post/getting-started-with-mongodb-and-java-part-i ?
honestly the only tangible difference between performance on those two hosts will be which one oversells more.
This is bungeecord!
For some reason the Item#setDisplayName gives me an error whenever I use it in any way. I know it's the displayname because when I remove only remove that method then it works. I don't get any error in console (not one in bungee nor spigot console) but I see this when I get kicked
This is the code: https://pastebin.com/x84W8a7H
@zenith siren what is the code ?
Yeah. I've read through it a couple times, and followed along with it. I understand how it works. There are two or three things I'm really looking for in a tutorial; reassure I am doing this right, how can I improve/what can I change.
@zenith siren what is the code ?
@upbeat wyvern
What are my options for controlling the Ender Dragon, like targeting and attacking? Don't want to WASD control it.
AFAIK you would need to mess with NMS stuff, it will be quite a pain to do so @naive stratus
Yeah I had a feeling that was the case
