#help-archived
1 messages · Page 216 of 1
hm do I run the class file from linux cli? I dont want to bother to put it into a jar rn
no idea
few decimals:
20256346 nanoseconds
many decimals:
20356270 nanoseconds
integer:
12286823 nanoseconds
some AMC Epic
AMD seems to be faster with integers
still wonky
(this is 1 million instead of 10k iterations)
lol really strange. my AMD seems to be faster with few decimals and integer being even faster while Intel is faster with more decimals and integer is the slowest on average lol
restarting again, giving it... 8gb of ram this time
might want to show how you tested these things before assuming that intel is really indeed being slower
and that AMD is being faster
rip me, https://i.imgur.com/xIgMk4A.png
what I did is not really comparable, I used Windows on Intel and Debian on AMD
also I should go to bed now, gotta visit my parents in a few hours^^
good evening everyone
damn, took 1 minute 20s, https://i.imgur.com/nMoDT35.png
Integers faster, yeah
100,000,000 values btw
https://pastebin.com/f6P4BbdX
@hollow root here
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
quick and dirty, it was just for fun^^
well I have a server with quad core xeon hyperthreaded 😉
I can test for intel but not AMD
._.
I tested on i7 9700K and on a VPS with 4 dedicated AMD EPYC 7702 cores
well after all it seems like it doesnt matter until you want to calculate 10 million of numbers at once^^
but its kinda strange that integers are slower for me on intel
(compared to doubles on the same CPU)
AMD is just superior :kappa:
intel is generally really good with floating points
I don't think the 7702 beats my 9700K 😛
but its a stupid comparison as the intel runs with ~4GHz and the epyc runs at 2ghz
https://www.jeffcloud.de/index.php/s/B85W4sBYR53qHkm ok 4,6 ghz right now
I will create a project for testing various primitives 😉
I can probably overclock mine with amd's overclock tool thingy
I am fairly certain intel has no problems with integers
https://www.jeffcloud.de/index.php/s/ZHyeKToPG4qaXog the AMD only got 1996 mhz but after all its a VPS
for some reason in my code this method is returning true when it should return false, (and is returning false when false) and I can't seem to understand what is wrong. My code is here: https://github.com/ramdon-person/SimplePolice/blob/master/SimplePolice/src/com/voidcitymc/plugins/SimplePolice/Jail.java#L67
help would be really appreciated
Should remove 1.13 compatibility and make it use Persistent Data Containers 👀
why remove 1.13 compat?
cause 1.14+ is persistent data containers
lol
1.13 is custom item tag (which only support item stacks)
but I mean it should be storing my data fine
anyways I don't actually test it on 1.13
and the api version I use in maven is 1.16
idrc about 1.13
I just leave the number as that
you don't have to worry about this if your using persistent data containers https://i.imgur.com/tK6517F.png
:)
It's used through one method in the main
so the data should be persistent
because theres only one instance
but it almost looks like the data isn't
thats why I'm really confused
I have a question about the api
I want to override one small part about generation
I don't want to completely rewrite generation
I just want to add a block that is generated underground
is this possible?
declaration: package: org.bukkit.event.world, class: ChunkPopulateEvent
you can edit blocks using that event
oh my bad thats on compleation
Recently I added a whole new section of API to Bukkit; Custom ChunkGenerators and BlockPopulators. I've had a world (sorry) of questions so I'll try to...
thanks
yup np
you don't have to worry about this if your using persistent data containers https://i.imgur.com/tK6517F.png
@quick arch
Omg I printed my maps out, and they are empty 😭
nice...
wtf how
I swear
at this rate I'm just going to store that stuff in the main class
Its opening two on my server command line and another
k
this aint good
Just use Persistent Data Containers at this point
Just use Persistent Data Containers at this point
I need that 1.13 support
also the memery IS SLOPING UP INSAINLY
idc for them
oh good
Old and stable version
1.12 ocean = 🤮
It is good for servers without lots of resources
Converting it to Persistent Data Container shouldn't take that long
the only good thing with 1.12, is glowstone
Converting it to Persistent Data Container shouldn't take that long
I'll look into that
@pastel condor 1.14+ performance 🤢
@nimble oar
1.16 performance > 1.14 performance
how do i make a hashmap anyway?
I already did some basic converting, https://i.imgur.com/ExDquf4.png
Probably could look like that
ty I'll look into that
?
also HashMap<String, String> mappy = new HashMap<String, String>();
then mappy.put("hi", "bye");
Where String, String is Key, Value
then mappy.get("hi") returns "bye"
Map<K, V> map = new HashMap<K, V>();
pretty sure Map is recommended over HashMap for the type
how do i make like a vault thing tho where it stores the blocks a player puts in the GUI to a haspmap thats under vaultPlayerName than when the server starts again it open a GUI with the blocks the player put in earlier?
you’ll need to store it somewhere when the server stops
yes.
that part is obivoud
but how do i save the blocks the player puts in the GUI
and use the hashmap to export to the GUI?
So you want a GUI that stores items?
If it isn't going to be accessed a lot, you can use a .yml file and some base 64 to ItemStack conversion
some base 64 to ItemStack conversion
no need if it's yaml, it already have a serializer https://i.imgur.com/JLqF8av.png
how do i dispay the lp rank next to the name with TAB plugin
@quick arch You're right
how do you even MAKE A TAB plugin.
issaa plugin
i am very curious today.
I heard that plugin breaks some other plugins 🤔
@frigid ember PlaceHolderAPI
https://luckperms.net/wiki/Placeholders
i do
I already did some basic converting, https://i.imgur.com/ExDquf4.png
@quick arch
I got super lazy and spammed the static keyword and now it works!
yo there's a table in the Java book I'm reading and it says something like
p & q p | q
False False
False True
False True
True True
``` Could someone explain to me what this means?
what are the true and false for
(fresh spigot-1.15.2.jar, and when I copy that and only that to a new folder, it works perfectly)
Apparently, the last sentence says the logical operators &, |, ^, !, support the basic logical operations AND, OR, XOR, and NOT, according to the following truth table.
I assume their ordered from AND to NOT from top to bottom?
Are there any good scripters here?
i'm not sure what's broken
looks like 2 chunks are corrupted
any high level devs here?
@quick arch those are brand new chunks
it happens for every new world regen
I'm debating on whether or not I should use ExactChoice, it says it's a draft API and it's marked as deprecated, so is that a good idea, or is it risky?
does spigot look through every folder to see if it a world?
i mean I dont have any corrupted worlds in my server folder, but this started to happen after I messed up a server close i think
after that ive redownloaded spigot.jar, deleted all worlds, renamed my plugins folder to "eh" and same error? How is it remembering the corrupt chunk?
is there some server cache that im missing
how? When the world is deleted
So you deleted the entire server
and reinstalled it
alll of the foldesr
everything
nope, just spigot.jar and world*
yea well the issue may persist
Idk exactly how spigot saves data
everything else is text files
logs and configs
last i checked world data isnt stored in configs
you deleted nether end as well
have you tried booting a new world without plugins at first
I can run it again if you want
there are no plugins
unless spigot checks every folder for plugins
i renamed my plugins folder to 'eh'
erm
but the logs do not load plugins
if you check the log there are no plugins loaded
something is storing that world data
i removed the plugins to narrow it down
corruptions dont just carry over
remove the plugins completely from the spigot
i would actually reccomend you create a new folder for a spigot server
How long does it usually take for a premium resource to be approved? Been waiting almost two weeks now
however long it takes ig
@lapis wedge are you using the same seed? or is it randomisde
theres no seed defined in server properties
I dont think there are any seeds that corrupt worlds though
actually its minecraft, there probably are
antvenom has some videos on seeds that corrupt worlds
yea but its randomseed here so I dont think thats the problem
unless im that mathematical 1/18,446,744,073,709,551,616 chance that gets the seed every time
every. time.
anyway I made a forum thread, cba with this anymore, i just thought it was a weird bug
How would I put armor on an NPC? (EntityPlayer spawned with Packets)
I've tried both this:
npc.getBukkitEntity().getEquipment().setHelmet(new org.bukkit.inventory.ItemStack(Material.DIAMOND_HELMET));
and this:
npc.getBukkitEntity().getInventory().setHelmet(new org.bukkit.inventory.ItemStack(Material.DIAMOND_HELMET));
But neither has worked for setting it. I've tried to update the inventory but it gives an error in console wen trying to update the invo.
I need help with Essentials I need help setting perms for the plugin BetterRTP, But when I set the perms, the Perms do not work and i am not able to /rtp in the "world world"
Npcs are fake entities so pretty sure you need to edit their inventory with packets
Do you know how to help me?
What packet would I need to use @frigid ember
Heyo anyone got a free plugin for prison backpacks and enchants?
I'm having trouble figuring out custom ore gen
does anyone know how to go about doing that?
I want to implement my own ores by combining it with a resource pack
but I don't know the math involved
or how to optimize it
what is java.lang.AssertionError: TRAP
and how do we prevent it guys?
Heyo anyone got a free plugin for prison backpacks and enchants?
anyone?
no one can pvp
is it possible to spawn items from the fishing loot table in a chest?
you are god
how do i make it so on a player's death i can change their gamemode to spectator mode?
i have this so far but im not sure if im doing this right
@EventHandler
public void onDeath(PlayerDeathEvent event){
Player player = event.getEntity().getPlayer();
event.setKeepInventory(false);
event.setDeathMessage("RIP");
}```
Is player.setGameMode not a thing or..?
I'm not sure, but after the death event, the player has to still press the "Respawn" button to be able to switch gamemodes.
If you're using spigot, you can force respawn the player using something like player.spigot.respawn();, and only then use player.setGameMode(gameMode);.
Alternative would be to listen to damage event, and if the current player health - damage dealt in the event is under or equal to zero, then cancel the event and set the players gamemode. (Way smoother than the previous method)
Hi, guys I want to make a home security system (privates), by type as / / wand can you throw links that need to be installed? Please! (1.16.1)
So you want a region protection system. I’d recommend worldguard for public locations and staff defined regions, and grief prevention for player managed claims (golden shovel)
@winged sparrow only WorldGuard? me just for spawn, that's all.
Worldguard will handle that just fine.
It’s a powerful plugin, be sure to read the documentation.
@winged sparrow worldedit, unnecessary?
May I ask you to send links? I beg you please
I’m not at my computer. Just look up world guard on google.
I believe the download is available via a link on Bukkit’s website.
How can I specify what type of damage spigot does to an entity? 1 damage of void or 1 damage of entity attacking
@spring coyote https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Entity.html#setLastDamageCause(org.bukkit.event.entity.EntityDamageEvent)
declaration: package: org.bukkit.entity, interface: Entity
What's the difference between BukkitScheduler and BukkitRunnable?
does anyone know how i can add an entity to the world and be able to interact with it with playerinteract event, i've tried added the entity to the world with
WorldServer#.addEntity(), i can see the entity but when i click on it nothing is happening. I can click other natural spawned entities and they work fine.
u mean like spawn an entity?
yeah, its spawning correctly but i cant interact with it
thats for a entity type, im trying to spawn a EntityPlayer
yes
is there a way to add/edit servers and add/edit forced hosts inside bungeecord without using /greload?
the paypal button is not working for me
Hello I have a method called getNumber with the parameter playername in my API class in my spigot plugin and I want to it return a number that is saved on my bungeecord plugin. Here is a small scehematic of the messages that I sent of what is happenning: https://prnt.sc/tte5bl. So explaining writing... in my method I send a message to bungee and then bungee when it gets that messages send a message for spigot with the number (the listener of received messages is in the main class). Now when I receive that number I add it in a Map... so in my method I need to send the message and then when the main class receives the message I need to return the number that is saying on the message (that was putted on a map). How can I do this? (I already made everything sending messages I just need to make something to wait until the Map contains the number and then yes get the number from it and return it on the method)
High quality UML diagram
The simplest way to do it is to use Redis actually, cause you'll need to play with threads if you follow your system. Have a look on CompletableFutures, could be usefull if you don't use Redis.
Guys need a little help
How are these flying spinning blocks achieved? I don't want code , I just don't know how they make them also unpickable
(from Hypixel skywars)
ArmorStands
bedwars*
Oh so it's just an invisible armor stand
Yep
Rotation + y moves
But only the head rotate, not the entire armor stand
That's what I used for my plugin: dropping non gravity items with nms is impossible
Rotate the entire armorstand is easier
Just teleport and change the yaw (or pitch don't remember(
But can't the armor stand only be rotated 90° at a time
No
Yep
Lol wtf
Everything is armor stands
Do you by any chance know how did some plugins made them bigger?
Like the balloons plugin
My thought was invisible giant zombie wearing block in head
@undone narwhal uuh ty I will try use COmpletableFeatures
how do isend meesages to the actionbar
Version?
Invisible, no gravity and Marker true
That's it @sturdy oar , invisible Giant Zombie
Or make many small armorstand blocks fit together
(way more complicated)
Damn I wish we had an API that actually wasn't just using hacks around Minecraft entities
Would be way more efficient than spamming the server with armorstand
.... i wish too but no
Hey guys, i just saw that i got banned, i didn't uderstand why?
@sturdy oar to make the rotation just teleport the armorstand to same location but change the yaw between -180f and 180f
It's really easy to get banned lmao, welcome to the club
@undone narwhal Yeah it's seems to be that way, but i really wanna know why, waht means "Bypassing the premiums resource requirements"
Did you follow the requirements to post a premium resources?
did you ever post a premium resource
@undone narwhal I just uploaded my resources on spigotmc but extenral link to other website
did you ever removed your screen from desk
but what's the problem? they allowing to to it are they?
They litteraly removed 2 resources with 200+ downloads :/
so they were free resources?
then you had two premium and one free, you also don't have enough messages or ratings
then you had two premium and one free, you also don't have enough messages or ratings
@ancient ridge Mmm i get it now...
hello o/ want some tips/advice. in my minigame i have leaderboards, and i store player stats in a database. is there any more efficient way of creating and sorting leaderboards other than caching the entire database? i use Caffeine to cache the data and all but querying everything from the database takes time when there are more than 1000 entries. although i have it all run async
I don't even know how you managed to post a premium resource in the first place
I don't even know how you managed to post a premium resource in the first place
@ancient ridge Instead of upload the jar i uploaded the link to mcMarket
There I am a premium
@sturdy oar to make the rotation just teleport the armorstand to same location but change the yaw between -180f and 180f
@undone narwhal how do you make them not fall?
lol well that's obviously bypassing it
you can't just link a free resource on spigot to a paid mcmarket one
@EventHandler
public void onClick(PlayerInteractEntityEvent e) {
if (e.getRightClicked() instanceof ArmorStand) {
System.out.println(e.getRightClicked().getCustomName());
if (e.getRightClicked().getName().equals("§8§l§o§o")) {
Player p = e.getPlayer();
p.sendMessage("egall!1");
}
}
}
Does anyone have an Idea why this is not returning anything? There is no Error. It just does not return the name of the armorstand.
well using § is a bad idea
But i use color codes for a blank name
you can't just link a free resource on spigot to a paid mcmarket one
@ancient ridge Yeah now it's sounds kind of silly...
ChatColor#stripColor
if it gets clicked it opens a menu
?
It does not return anything in the console
When i click that armor stand
@EventHandler public void onClick(PlayerInteractEntityEvent e) { if (e.getRightClicked() instanceof ArmorStand) { System.out.println(e.getRightClicked().getCustomName()); if (e.getRightClicked().getName().equals("§8§l§o§o")) { Player p = e.getPlayer(); p.sendMessage("egall!1"); } } }Does anyone have an Idea why this is not returning anything? There is no Error. It just does not return the name of the armorstand.
@umbral dirge Try to check if it's contains§8§l§o§oand no equals, sometimes it's solving everything lol
@umbral dirge Try to check if it's contains
§8§l§o§oand no equals, sometimes it's solving everything lol
@hot anvil Also check in console if there is errors or null exceptions about the println of custom name
There is nothing getting printed out
You registered the event?
yes
Try to do a if statement to instanceof and check if it's armourstand print in chat true if else print false,
if (ChatColor.stripColor(e.getRightClicked().getName().toLowerCase()).contains("armorstandname")) {
if you see the false it's means the problem in instance, probably you are not clicking on armour stand
if you not getting any print it's means the event not called.
Try them both each
@EventHandler
public void onClick(PlayerInteractEntityEvent e) {
if (e.getRightClicked() instanceof ArmorStand) {
System.out.println("Instanceof ArmourStand");
System.out.println(e.getRightClicked().getCustomName());
if (e.getRightClicked().getName().equals("§8§l§o§o")) {
Player p = e.getPlayer();
p.sendMessage("egall!1");
}
} else {
System.out.println("Not instanceof ArmourStand");
}
}
@EventHandler
public void onClick(PlayerInteractEntityEvent e) {
try{
if (e.getRightClicked() instanceof ArmorStand) {
System.out.println("Instanceof ArmourStand");
System.out.println(e.getRightClicked().getCustomName());
if (e.getRightClicked().getName().equals("§8§l§o§o")) {
Player p = e.getPlayer();
p.sendMessage("egall!1");
}
} else {
System.out.println("Not instanceof ArmourStand");
}
} catch(Exception e){
e.printStackTrace();
}
}
You have to get some console message.
makes no sense
you cant get exception because instanceof is null "checker" also
but the armorstands arent "entitys"
you cant get exception because instanceof is null "checker" also
@rare prairie The exception it's about the whole process, just to make sure.
declaration: package: org.bukkit.entity, interface: Entity
the plugin thinks the armorstands arent entitys
@rare prairie The exception it's about the whole process, just to make sure.
thats unecessary
thats unecessary
@rare prairie Okay, try the first one which checks if instance of armour or not
if you see Nullable annotation, that can be null
declaration: package: org.bukkit.entity, interface: ArmorStand
armorstand is can be an entity
try PlayerInteractAtEntityEvent event
How did you solved it?
try
PlayerInteractAtEntityEventevent
@hot anvil
🙂
:D
how do i send action bar messages
packets i think
NOTE: You must be using 1.8 or this will not work!
Okay lets get started:
[SPOILER]
[SPOILER]
public void onPlayerJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
ActionBar actionBar = new ActionBar(ChatColor.GOLD + "Hello world");
actionBar.sendToPlayer(p);
}
dont use packets
p.spigot().sendMessage(ChatMessageType.ACTION_BAR, "")
^^^
"old versions" good enough (:
there are very few things you need packets or nms for in 1.13.2+
there are very few things you need packets or nms for in 1.13.2+
@forest thorn They love to make our lives harder than they are already.. -.-
p.spigot().sendMessage(ChatMessageType.ACTION_BAR, "")
@hot anvil it says no valid method
@sturdy oar ArmorStand#setGravity (sorry for ma late)
Which version you using?
1.16
Yeah try to make sure.
try this
BaseComponent component = new TextComponent( "My text!");
player.spigot().sendMessage(component);
does Material.values()[ThreadLocalRandom.current().nextInt(Material.values().length)]; select a random item?
Did you tried this code already?
yes
@hot anvil i did not try it yet
Okay thanks
alongside it
it sayd bad operating types when i use ChatMessageType.ACTION_BAR+ChatColor.GREEN
@hollow thorn uhh
you need to use the chat color in the message
not the chat message type
+1
Oh yeah and does the Block interface just mean like ACTUAL blocks in the world or does it means like their time like grass block
oh yeah now it says no suitable method
send the code
what imports do i need to use
build your project
it doesnt let me because of the error
import org.bukkit.ChatColor;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.TextComponent;
?paste
I mean which line
@hot anvil 120
me.spigot().sendMessage(ChatMessageType.CHAT, "ye");
That's not how you use it
BaseComponent component = new TextComponent( "My text!");
player.spigot().sendMessage(component);
Try this way
Also if it's not critical you can use § sign as color instead of ChatColor it.
works
Also if it's not critical you can use
§sign as color instead of ChatColor it.
@hot anvil i use windows they dont have that
and like is Block just an actual block in the world
"§" is translated in every text component. So actionbar titles lore etc
AtinChing what do you mean
Yes(ish) Block represents the actual Block in the World.
Its still abstracted but it refers to the actual instance.
final PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection; final IChatBaseComponent chatBaseComponent = new ChatMessage("text");
final PacketPlayOutChat chatPacket = new PacketPlayOutChat(chatBaseComponent, 0x02); playerConnection.sendPacket(chatPacket);
``` @hollow thorn
hello, it's possible to make a mob disappear if it doesn't do any damage for a while ?
Does anyone have a good "recipe" for creating MineCraft Server as a Windows-Service - what i've tried works in accordance to the log (server should be up and unning), but i cannot connect to it and doesent show the CMD/Console when running
I can make it work fine with just a BAT file - but i cant seem to work out how to make it as a service
@hot anvil i mean like if i do Block does it reference to an actual block in the world or like a block type
Havn't done so for years, but I used McMyAdmin as a service on win 2008 back in the day
Which worked fine, the majority of the time
The majority here uses Linux for server hosting 😐
hello, it's possible to make a mob disappear if it doesn't do any damage for a while ?
@dreamy glacier you could use a persistant data tag to say the last time it did any damage then check every 20 ticks to see if it a certain time past that before deleting it if it is
HashMap > PersistentDataContainer
999% faster
Also I don't see why he would need this to be persistent
Thanks Niall - I'll take a look at it - or reinstall it as Linux as Viper indirectly suggests (O.o)
Is there a spigotmc API to check if a user brought a plugin?
Im having a Coin System, and is there a way how to get a list from the top 10 richest players?
@umbral dirge Yes. But it highly depends on your implementation.
Do you use mysql or mongodb for storage?
Then you can simply use a query to only get X entries with the highest value in one property.
How?
select * from {table} order by coins limit 10
For example SELECT TOP 3 * FROM CoinHolders
iterate over the resultset and add it to the arraylist
resultset.next()?
ResultSet rs = query;
while (rs.next()) {
...
}
oh k
Harry your first query will order the whole table... this will take a time if he has a lot of entries.
I think a TOP call is better here.
Uh how would i get the display name for a material?
didn't even know top was a thing in mysql tbh
how do i set the max value for a bossbar
Like i dont want it to say "You need to find GRASS_BLOCK" in chat
I need it to say "You need to find a Grass Block"
also wont you need to order the whole table, to ensure you get the top x records?
Remove _ and make it lower case except the first char
just having an index on the coins column in the correct order would make the order a lot faster
That is not how you should work with localized names. You can probably do something with the namespaced key and get the name for the players language settings.
Yes, so replace _ by a space and make it lowercase , except first case of word
Material.GRASS_BLOCK.name().replace('_', ' ') if you want to do it that way, but yes @grim halo is right
Ohh okay
how do i set the max value for a bossbar
wat? did you mean the progress value?
The max value is always 1.0
you can, between 0.0 and 1.0
you can't change the max value tho
bossbar progress value?
assuming that's what you/they are referring to, yes
so what does NamespacedKey.minecraft(exampleMaterial.name()); do
Adds minecraft infront of it
how do i loop through the hashmap now? public static HashMap<String, Long> top10 = new HashMap<>();
It creates a NamespacedKey minecraft:name
Get the entryset,keyset or valueset @umbral dirge
for(int i = 0; i < CoinsDB.top10.size(); i++) { p.sendMessage("§8● §3§lSkyU §8» §7" + CoinsDB.top10. + " Coins§8: §7"); }
Ive yet to figure out how to work with namespacedkeys
@umbral dirge You should generally not hava a public static datastructure. But the simplest way would be iterating the keySet.
He probably want the entryset too
Cause, he wants name and value
prolly
idk i'm guessing.
@blazing burrow namespacedkeys are just keys. You need the right environment to get the values you want.
@umbral dirge A HashMap does not provide ordering. The elements in there are randomly arranged.
What bout a Map
Oh damn okay
You need to order all your element
Use a LinkedHashMap i suppose
Compare then or use a LinkedHashMap
A Map is just a generalisation of HashMap
A Map is the interface HashMap is implementing.
I usually don't like using Map
uh
LinkedHashMap would be a solution but i think this is a xy problem.
You rarely want ordering from a map.
Yes
how do i set the max value of a bossbar
?
with a bossbar you can set the maximum value of it
Mac value is 1
yo
so awhile a go it was recommended to me that I should make all my variables private, which I've now done
and use a getter
the reason for this given to me was that it stops the value being changed when it shouldn't be (by other programmes)
but private doesn't stop that right as you can still use reflection?
surely just using public final is fine
final is fine. But that means that once a value is assigned once
And the value can be set either directly, or through the constructor
How would I replace a string with a list from the config
I don't understand your usecase
Hello! How to get item slot in a player inventory?
Get the player's inventory
Then?
Ahh
declaration: package: org.bukkit.inventory, interface: Inventory
Im trying to make everyone have perms for "moar bows" plugin can anyone help me ?
how to change a player skin?
gameprofile, getproperties
I don't understand
Hi. Is there any reason why this wouldn't register as proper recipe?
ItemStack egg = new ItemStack(Material.EGG);
ItemMeta eggIm = egg.getItemMeta();
eggIm.setDisplayName("Epic Egg");
ItemStack eggHelmet = new ItemStack(Material.GOLDEN_HELMET);
ItemMeta eggHelmetIm = eggHelmet.getItemMeta();
eggHelmetIm.setDisplayName("Hard Helmet");
ShapedRecipe recipe = new ShapedRecipe(eggHelmet);
recipe.shape("EEE","EAE","EEE");
recipe.setIngredient('*', egg);
recipe.setIngredient('B', Material.AIR);
getServer().addRecipe(recipe);```
(Trying to use ItemMeta so only a certain named item can be used to craft)
change setIngredient to "E" or "A"
bah
idk
yeah that
Okay so first of, this is depricated, does anyone know the new one? https://prnt.sc/ttsj47
And this? https://prnt.sc/ttsjcm
take a look at docs
take a look at docs
@rare prairie Sure, I've tried, mind pointing me somewhere? Kind of why I came here.
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ShapedRecipe.html#<init>(org.bukkit.NamespacedKey,org.bukkit.inventory.ItemStack)
or https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ShapelessRecipe.html#<init>(org.bukkit.NamespacedKey,org.bukkit.inventory.ItemStack)
declaration: package: org.bukkit.inventory, class: ShapedRecipe
declaration: package: org.bukkit.inventory, class: ShapelessRecipe
Does anyone know moar bows plugin?
If yes i need help with perms
Only ops can shoot bows but normal players cant
@lime crater so use new ShapedRecipe(eggHelmet.getType().getKey(), eggHelmet);
Does anyone know moar bows plugin?
better to ask the developer of that plugin
No idea if this is possible so, with tab completion, can you add a command to it that isn't defined in the plugin.yml / isn't under another command's aliases.
yes, you can
Know where I can find a guide?
Oh wait, think I see how. getCompletions is mutable on TabCompleteEvent.
@lime crater so use
new ShapedRecipe(eggHelmet.getType(), eggHelmet);
@rare prairie It says required type NamespacedKey, not Material.
Discord is dying again great
yep, .getType().getKey()
i am using multiverse and i was wondering what the command is to only have certain mobs spawn? such as onyl endermen and endermite
you can't, you can only setup that the mobs can spawn in worlds, you can find a plugin for that
ah that appears to be working. I'm still not quite sure about the setIngredient though
you can use, https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ShapedRecipe.html#setIngredient(char,org.bukkit.Material)
recipe.setIngredient('*', egg.getType());
declaration: package: org.bukkit.inventory, class: ShapedRecipe
@lime crater
java.lang.IllegalStateException: Duplicate recipe ignored with ID minecraft:golden_helmet
ItemStack egg = new ItemStack(Material.EGG);
ItemMeta eggIm = egg.getItemMeta();
eggIm.setDisplayName("Epic Egg");
ItemStack eggHelmet = new ItemStack(Material.GOLDEN_HELMET);
ItemMeta eggHelmetIm = eggHelmet.getItemMeta();
eggHelmetIm.setDisplayName("Hard Helmet");
ShapedRecipe recipe = new ShapedRecipe(eggHelmet.getType().getKey(), eggHelmet);
recipe.shape("EEE","EAE","AAA");
recipe.setIngredient('E', egg.getType());
recipe.setIngredient('A', Material.AIR);
getServer().addRecipe(recipe);```
All I have, I genuinely don't see how it's a duplicate recipe
you can use again https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Server.html#clearRecipes()
to clear all recipes that you added before. You should call this method before the shapedrecipe
declaration: package: org.bukkit, interface: Server
@lime crater
declaration: package: org.bukkit.entity, interface: Player
i have made a plugin using spigot but when i use it in my server it says in the logs that it has not specified API verson pls help
it describes, add api-version to your plugin.yml
oh ok so i cn add
api-version: 1.0
is that right?
ok ty for help
Is this just a list of recipes that clears?
the list of added recipes
how do i make a bossbar compass
use google
i can only find plugin names
- Create a bossbar
- Check the direction of the player
- Convert the direction in to a suitable compass string
- Set the bossbar name to that string
- Repeat
@hollow thorn
Yeah it takes like 5m to do that
^
It's super simple
You just need to check the YAW of the player and have a static method that produces a string based on that number
I recommend to round the values
to integer
?
click the link ;-;
You have LuckPerms?
Im just having a survival server with friends
why I need that
dont I need just to go to config and put perms?
To Manage permissions?
so everyone can use
LuckPerms is a permission manager
Is there any good ways to utilise redis pubsub to have a response/acknowledge system
http://prntscr.com/tttqeq well check this link so u can see where I put perms so people can use it u can see what wrongs did I do
You either use the permissions.yml file in the server or you use LuckPerms to give permissions to someone.
I can't help any further
okay thanks
I'm trying to launch a boat with a player inside in the air, but it only works with boats with no players inside. I've tried setting the Motion with commands (this actually sometimes worked) and setting the velocity with setVelocity(). Any idea how I could achieve my goal?
Well what are good survival plugins im on aternos and im struggling to find some
its just survival with plugins btw so dont put any LuckPerms,essentials/etc
uh SmoothTimber?
anyone know why this happens ? 4.08 08:37:57 [Server] ERROR Cannot execute command 'msg' in plugin ChatManager v3.6.5 - plugin is disabled. 04.08 08:37:57 [Server] INFO org.bukkit.command.CommandException: Cannot execute command 'msg' in plugin ChatManager v3.6.5 - plugin is disabled.
Plugin is disabled
That or find why it's disabled
Could it be that Bukkit.getWorld(String name) returns null inside JavaPlugin#onEnable() and that I have to schedule it as a task, or is something else wrong?
plugins load by default POSTWORLD unless you added load to your plugin.yml
Any good survival plugins? its just a survival server with few friends im on aternos btw
whats the name of the event for opening the inventory
Any good survival plugins? its just a survival server with few friends im on aternos btw
@frigid ember slimefun
whats the name of the event for opening the inventory
@hollow thorn https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryOpenEvent.html
declaration: package: org.bukkit.event.inventory, class: InventoryOpenEvent
What are some minigame server plugins I'm gonna need?
Grab a permission plugin like LuckPerms
^^
Ok
Other than that it depends
I also need citizens npcs that stand still so when they click one it tps them to the game
how can i change the player name tag in 1.16.1
Just get citizens
You making a plugin or looking for one? @dry horizon
making one
NMS
yes how
scoreboards
btw i just want to change the color
Scoreboards then
teams, right?
Yeah
I honestly just edit clientbound packets but whatever
aight
Any good survival plugins that I can use with my friends on 1.16.1? Im on aternos
No need to ask every 5 minutes
Anyway if it's just for your friends you don't need any
Aternos is so bad
I usually just buy shared hosting
You can get a 3GB server for 92$ a year on MelonCube
well what bout free ones?
😂 😂 😂
xd
free = 💩 ,
No one will keep a computer running 24/7 for you for free
A raspberry PI is better than free hosting
does /n work in lore
no
free < any pc even old ones
@tiny dagger unless if you want it up all the time
aren't host incredibly cheap nowdays anyway?
How can I send a custom packet?
A packet which has the payload I want.
@rare prairie hey can i add the api version under the normal plugin version?(in plugin.yml)
the client listens only to certain channels and throws away packets that are not valid to it,
Only thing that needs to be imported there is CraftPlayer
@echo path https://www.spigotmc.org/wiki/plugin-yml/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
hmm
?paste
thanks and which api-version should i use for a 1.16.1 plugin?
'1.16'
👍
@frigid ember You need to properly parse your command input to numbers.
if you want to support older versions put '1.13'
if you do this:
Integer.parseInt("Hi");
You get a NumberFormatException
does ItemStack.isSimilar() check the stack size?
@formal nimbus No
N o
Its basically equals without respecting stack size
when PlayerKits will run on 1.16.1?
just like you would nromally do... with .equals()
== would compare instances and this will not work in most cases
nah nah, .equals() is where it's at
Ask the dev
Ask the developer of the plugin for help
who is it
Bill Gates
No idea. Read it on the plugin page.
Its actually drives_a_ford
he is in here surely likes to get pinged
Just ping him and tell him that his plugin doesnt work because he doesnt know how spigot works
?
with "@"
Leave 1 star review:
"Plugin sucks uninstalling xd1!1!1!1!11!1!"
no just post entire server log in review
And post an error log from another unrelated plugin below that
Yes much better, also advertise something in the bottom
post a 1 star review with "." and "my plugin is better, this sux"
Yes
"this plugin sucks, author provided help only after 3h of wait!!! Here is log:
https://pastebin.com
Also guys join my server, we use more professional plugins
play.hypixel.com"
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
😂
lagpixel
I own cloudflare Minecraft server
come join at ray.cloudflare.com
???
u running offline-mode?
do I need premium to use modpacks on aternos?
Hello, is anyone good with database and can explain why I am getting this error thanks
i need a help, on 1.12.2 spigot when im entering mesa biome server automatically crash so i stuck and i cant do nothing about it.
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
Connection is closed
I ain't closing the connection tho?
Someone is using closed connection
@sturdy oar idk do you know but do modpacks work on aternos without premium?
It's after a result set
Get a real server
then why the fuck they put modpacks there
u cant use spigot and forge on aternos
waht about magma/fabric?
?paste
@silver pewter post your code
fabric is 1.14.4 and mods only
@silver pewter Use something like hikaricp to manage your connections
and magma?
magma is kind of weird
but u cant use custom jars on aternos
so
magma is probably the only option
because CatServer seems better
No I'm using mysql
Or Sponge server
Ok, so I downloaded the BuildTools for 1.16, but how do I get it to appear as an option when creating a new project on IntelliJ IDEA?
???
I've never used databases with java before so I'm like idk lol
Like, for compiling as a plugin
Do you need the spigot API?
Or Sponge server
@sturdy oar dont sponge is like the weird brother of spigot
I do @sturdy oar
@silver pewter Close the statement and result set after using them in your methods. Also post your full class and the full error.
where is line 70
Statement statement = plugin.getDatabaseManager().getConnection().createStatement();
Thats why i told you to use hikaricp. You are trying to prepare a statement on a closed connection...
Im assuming you only manage one connection right?
that’s what it looked like
Ok and in the addAllRewards methods. Where do you open the connection?
onEnable
Wait... you open one connection in the onEnable and then try to keep it open untill the server closes?
Yeah

Should only be opened when I need to use it then?
Normally you would have a connection pool that just handles all of that boilerplate for you. You simply just tell it "give me a connection"
and then forget about it.
Figured it out, tyvm
Yes. Write code and the output jar will differ
add
volatile static int X = 100;
And your output jar will differ
are you talking about changing the location of the output jar or the output jar itself?
Oh. Thats another story. The output directory. Do you use maven?
Ok then there are multiple ways. The simplest one:
<build>
<directory>my_new_build_path</directory>
</build>
Or if you use the maven jar plugin
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<outputDirectory>${dir}</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
http://prntscr.com/ttw7b2 wtf is this
how do i use the Recipe.setGroup()?
Use the java docs...
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ShapedRecipe.html#setGroup(java.lang.String)
@hollow thorn
declaration: package: org.bukkit.inventory, class: ShapedRecipe
hm?
You don't have vault
?
Vault plugin is a dependency for bossshop to work with economy plugins
To fix that install Vault
but shouldnt spigot throw a "unknown dependency" at you first?
I guess someone forgot to add it as a dependency in the plugin.yml
That's what I can think of :/
Or maybe there's something else named Vault
Use the java docs...
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ShapedRecipe.html#setGroup(java.lang.String)
@hollow thorn
@mellow wave so how do i put a recipe in a certai nsub section of a crafting book
declaration: package: org.bukkit.inventory, class: ShapedRecipe
also how do i set the bal for some1
Anyone know how to setblock a spawner with a custom entity
essentials
/eco
ok
@candid wyvern Vanilla or with a plugin?
plugin
@candid wyvern Get the BlockState -> cast to CreatureSpawner -> CreatureSpawner#setSpawnedType(EntityType creatureType)
declaration: package: org.bukkit.block, interface: CreatureSpawner
^ Or use NMS for more options when setting the entity
Yes if you want it to spawn custom stuff then you need to use NMS
for some reason I cant install forge
btw why isnt there an api for that?
@frigid ember Ask for help in the forge forum/discord
okay
Read what it says
@mellow wave so how do i know the different names for the groups
do i just write Redstone?
- Take a vanilla recipe
- get the group from it
- print the name
- Profit
Now it isn't too hard to figure out
whats the code to enter the api version again in plugins.yml
api-version
api-version: 'whatever'
Kinda ironic btw..
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
- Take a vanilla recipe
- get the group from it
- print the name
- Profit
@mellow wave how do i get vannila recipe
...
Stop pinging me and use the javadocs I sent
There's a search bar you can look around
hey Olivo 😊
oh hi
Stop pinging me and use the javadocs I sent
@(you get the idea) sorry cant find anything
declaration: package: org.bukkit, class: Bukkit
It's a list get one of the entries
@hollow thorn
guys help, whenever i join my server it kicks me for the reason "Connection lost to the proxy"
Is the connection to the proxy stable?
That means you have bad internet basically
^
how i was connected to a localhosted server earlier and it was okay
now when i connect to the network it kicks me
"[Proxy] Lost connection to the server"
just because it was ok before doesn’t mean it’ll always be ok :/
There are many reasons why that error can happen
hmm
I have a question
so look at dis code here right
I plan to make only one instance of Tracker
in my main
however
so you want a singleton class
Basicly there is only going to be one instance of that class at all times
yes
what I've done at the moment is instantiate it on onEnable()
then make a getter
which all the other classes can use
then at the start of each class I'll have
Tracker tracker = myMainClass.getInstance().getTracker();
so how do I make a singleton class?
Easy
So what you need to do is set the constructor to private
uh huh
@mellow wave @frigid ember my connection is ok, when i join the server it kicks me right away after 2 secs
just make a private variable which is the instance and then create a method that checks for the instance
if its null then create a new instance and return it
So, I am trying to give this ArmorStand something in its helmet slot for the spawner, but the setSpawnedType method only takes an EntityType which is an Enum
spawner.setSpawnedType(EntityType.ARMOR_STAND);
Create the instance staticly instead
@past basalt then it just might be a server problem
does it happen to any other servers)
static {
instance = new <InsertClassHere>
}
yo, what's the order of operator precedence?
private static Class1 _instance;
public static Class1 getInstance() {
if(_instance == null)
_instance = new Class1();
return _instance;
}
Yeah that works too
@formal nimbus