#help-development
1 messages · Page 1574 of 1
Isn't it CompoundNBT?
ok so lemme try to understand this, first you are setting up an itemstack that is the item that took durability damage, then you are getting the meta of that item, then you are editing the meta to remove all damage done to the item, and finally you save the meta data back into the item stack?
i think
Yes
https://prnt.sc/1b4e32a everything is gone 😦
I use Mojmaps for Forge so it might be the same
Props to you for trying to understand why something works before pasting it in btw Epic
hmm yeah Olivo it seems to be that
This is why Mojmaps are great
Since everyone is starting to use them it's the same everywhere
thanks lol, its not learning if im just copying and pasting
for instance params
Exactly!
Yeah params...
Yes PaRaMs!
They're missing but you can generally figure out what you need
If not you look up the MCP mappings
also why net.minecraft package is removed?
oh no
i did a big stupid
for the Damageable damageable part
it said something about not being supported in the java version i was writing the plugin in
so i just clicked update version
im using maven is there any extra dependency for this?
now the plugin won't load
Run BuildTools and depend on spigot not spigot-api
and idk how to fix it
Error:
https://haste-bin.xyz/jizodetofu.java
Code:
try {
List array = new ArrayList();
ResultSet result = PVP.plugin.getManager().getSQL().query("SELECT * FROM PVP_stats ORDER BY 'kills' DESC LIMIT 10");
int counter = 0;
while(result.next()) {
array.set(counter, result.getString("uuid") + "." + result.getInt("kills"));
counter++;
}
for (int i = 0; i < array.toArray().length; i++) {
String[] array_result = array.get(i).toString().split(".");
String username;
try {
ResultSet name = PVP.plugin.getManager().getSQL().query("SELECT * FROM names WHERE uuid = ('" + array_result[0] + "')");
if(name.next()) {
username = name.getString("username");
} else {
username = "Unknown";
}
} catch (SQLException var7) {
username = "Unknown";
}
player.sendMessage(PVP.translate("&6" + username + ": &7" + array_result[1] + "kills"));
}
} catch (SQLException var7) {
var7.printStackTrace();
}
?paste
Someone know?
-.-
ik
you need to use add not set!!
Ok thanks!
cant voice
but it need be add(int,string)?
ok wait
I want to hear this wonderful speech
@ivory sleet the Damageable damageable part shows an error saying that pattern matching instanceof expressions is only available with source 16 and above
no worries, he's busy coding
well i dont know what variable i would use isntread of damgeable
would i use like
(Damageable) meta
You'd think
noooooo
Damageable damageable = (Damageable) meta;
ohhhhhhhhhhhhh
basic java ma'am
im stupid
wyd instead?
i was kinda close tho 😁
ok this line doesnt work damageable.setDamage(0);
the code triggers
cuz i added a sendMessage to test
do i have to remeerge the damageable variable into meta?
or maybe the stack.setItemMeta(meta); doesnt work
you shoudl be able to use setItemMeta(damageable)
cast it back then
setItemMeta( (ItemMeta) damageable )
or I'm having a brain fart
Where did you put the sendMessage?
Using meta should work just fine
Here I'll send code
ItemStack stack = event.getItem();
ItemMeta meta = event.getItem().getItemMeta();
if (meta instanceof Damageable) {
Damageable damageable = (Damageable) meta;
event.getPlayer().sendMessage("first");
if (damageable.getDamage()==0){
event.getPlayer().sendMessage("second");
damageable.setDamage(0);
stack.setItemMeta(meta);
}
}
Why are you checking if the damage is 0 and then setting it back to 0?
getDamage gets the damage before the durability loss
i want this to only work if the tool is new
so you cant get a like a broken bow from a skeleton and use it
You want to check event.getDamage() and just cancel the event if your item is full health
PlayerItemDamageEvent
no event.getDamage() is before the loss
i've tested it
No, thats the amount of damage the tool will take
Use the event methods yeah
wait
If you want to remove all damage cancel the event
?eventapi
so check durability of your item, if 0 cancel the event
yeah i was thinking damageable.getDamage()
oops
hi does inventory.setExtraContents() adds the items to a free hotbar slot and then to the inventory itself?
Pretty sure it doesn't set the inventory itself
What defines an extra slot is up to the implementation, however it will not be contained within Inventory.getStorageContents() or getArmorContents()
Hey, for our Roleplay Server we want to hide Every Player from the Tablist (including their head and their name, we don't want to have empty names).
After reading a bunch of SpigotMC Threads I wound a Solution which was approved by other people, but unfortunately this Solution only somewhat works.
We want to use Packets for that task, attached you will find a Link to my current code.
https://paste.sentinalcoding.eu/KcFi47mwJV this is the current code, once the named_entity_spawn packet is being Sent, it adds the Player to the Tablist for about 10 secs and removes him again. That has to be done for the Minecraft Client to be able to render the Skin. It somewhat works, most of the time its fine, but we have alot of Players complaining that sometimes the Skins are just Alex or Steve. After trying to reproduce it, I noticed that too.
is there a way to prevent farmland transforming in dirt (when there isn't any water) ?
Why are you sending a add player packet every time the NAMED_ENTITY_SPAWN packet is sent
because the player is removed from the tablist
CommandSender#getName returns CONSOLE if its console sender?
If you don't want it shown in tab listen to the player info packet. and then queue your remove packet
well then the players are invisible
Okay so I listen to the Player Info Packet and then just send the remove packet?
Yes
could you give me an example? because when we removed them from the tablist the players aren't getting rendered anymore
1.16.4/5
Alright I did that
By looking at the code I'm removing the player in the same way. But I'm just using the PlayerJoinEvent to remove the player
Anyway I still have no idea why you're sending the player add info packet
well because we didn't find any info on how todo it, so we just tried around, on join we removed them from the Tablist, and everytime the named_entity_spawn packet is send we add them back for 10 sec, it worked atleast semi.
How can I slow down the hunger of a specific player?
well we remove them in the onjoin, but once we leave the player's render distance and get back into it the player stays invisible
You can't remove pathfinding for withers?
or what is happening?
Listen to the EntityExhaustionEvent and cancel it when you want it to not take hunger
according to google that is normal Behaviour as when the player is missing in the tablist the client won't render
It rendered just fine for me
even if you get out of the players render distance?
Maybe because we were right next to eachother to begin with
can you try to run away from each other until you despawn and then get back together
Hm I guess
ima just bump this, in the hope that someone has a solution
Will FoodLevelChangeEvent work?
Yeah that too
Let's say I want to slow down the hunger 2x, how do I cancel the event every other time?
i think theres a saturation thing that handles how much hunger you loose over time
let me google it
yea in player you have getSaturation and setSaturation
declaration: package: org.bukkit.entity, interface: HumanEntity
i don't want to modify saturation, i want to modify how quickly the hunger bar goes down when saturation is 0
Looks like you're right
Player dissapears if you go out of range and come back again
how can I create a sign where I can write in for example a player name? IN 1.8.9
Like a menu?
yea
NMS and packets
and how=
I found nothing
I can open signs, but I cant get the text or make a sign with text inside
but I know a server who have this feature in 1.8
its possible
and?
but how?
XD
xD
What I'm trying now is using a counter variable and cancelling the event every time it reaches a certain number, but that won't work if there's multiple players because there's only one counter. is there a way i can have a counter for each player?
Well maps of UUID to integer is one way
hashmap<uuid,int>
or long idk
Probably don't need a long
how to make custom id for custom item?
how about you elaborate a little more
Bump as I see Conclure is active, maybe he has another advise :c
I think your solution is what you need to do. You can probably change 10 seconds to 1 tick though
uuid is a built in java class?
Yes
yes
kk
well that did not work... it literally says in the message
Well try cancelling the add packet and resend it after you send the player packet
the add packet is important, if the player is not in the tablist the client doesn't render players
thats why they stay invisible
Hello! How do I make wither "friendly"? I just want him to follow player. How do I do that? Since wither is flyer there is no initPathfinder() that I can modify
Not that add packet. The NAMED_ENTITY_SPAWN packet
yo gamers whats the bungeecord forwarding contents of C01 again?
Cancel it add player to tab and then resend it
in the ip field
that would cause a Stackoverflow, because everytime you send the packet it calls the onPacketSend
and what seperator
that would cancel again and go into an infinite loop
You can work around that
Is there a way to make mobs not focus on the player? Setting their target to not be the player does not stop them from noticing and looking at the player
nms
Well yes but what
\u0000 right?
easiest way would be to change to inject an adapter goal to their goal selector
wouldn't that make it too complicated, I am sure there is a simple solution. I just need someone experienced with Packets
Well you will probably have to wait a long time. Most people here aren't
Hmm, I'll look into that some more
Haven't done much with goals
well that is a Problem as I am trying to fix this for a month now
Do what I said and add a simple check to prevent stackoverflows and see if that works
well what should I check for?
oh right skeagle, it might be hard then
It can be done in many ways. Inject something in to the packet that you can check or store the packet in a map so you can detect your own
Hey, anyone knows why RED_WOOL is not a legit enum material in spigot 1.16.5?
Or like
How can I use wools like that
how to get a supergoldenapple on a sell / buy sign? (Enchanted_Golden_Apple) is to long to get on the sign.
sounds like you're using a legacy version
RED_WOOL is a valid Material enum in 1.16.5
api version in your plugin.yml
no
1.13 < is mostly considered legacy like actual legacy versions
the entry is ignored pre 1.13
It means the plugin was made for an old version pre 1.13 with old material ids
how to get a supergoldenapple on a sell / buy sign? (Enchanted_Golden_Apple) is to long to get on the sign.
But my plugin is 1.16.5?
So some thing doesnt know that if i dont specify the api-version?
Then tell the server that by setting the api version
Okay gotchu
So legacy basically means that this plugin is older than 1.13?
If i were to say legacy 1.13
no
I mean we talk about it more as a flag
like does the plugin support legacy versions?
Okay so
So 1.13 is legacy, cuz it is compatitable with other versions?
I mean some other
no
pre 1.13 is legacy since in 1.13 item ids changed
its just an old version
no it goes down all the way to like pre 1.0.0
can you store custom nbt data in an ItemStack and then have your plugin handle any ItemStack with said custom field?
So whats higher than 1.13 considered?
Aight
Is there a way to make it look like the player is carrying a backpack without nms usage?
Where would that backpack be?
Hopefully on the back of the player
I was thinking the use of armor stands and make it invis mounting the player,would it be lagging behind but appear to be on the player?
You can use CustomModelData on a chest plate to get the backpack to look good
@ashen flicker is assisting with this... @chrome beacon not wanting to use any custom textures
Well then lagging behind the player is the only way
Hmm
Just use pdc
How i can find the config path of my plugin?
getDataFolder()
Depends where you're doing it
You just need an instance of your plugin
If you're in your Main plugin class just do this.getDataFolder()
else?
Just get your plugin instance and call getDataFolder on that
ok, thanks
?pdc
ah ok thanks
Ah yeah I forgot about that
When trying to get the border of the world (/worldborder get) in the chat does not say anything
Server is running CraftBukkit version 3180-Spigot-38e6c03-ca0fe5b (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT)
I am trying to set a boundary via code
WorldBorder wb = world.getWorldBorder();
wb.setCenter(0,0);
wb.setSize(128);
Changes only when the server is restarted
so it does change when you restart the server?
and your problem Is that /worldboarder get doesn't output anything?
where do you have your code located?
The problem is that the boundary does not change, either through commands or code
BorderCommand.java
public class BorderCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
if (commandSender instanceof Player) {
Player player = (Player) commandSender;
World world = player.getWorld();
WorldBorder wb = world.getWorldBorder();
wb.setCenter(0,0);
wb.setSize(128);
}
return true;
}
}
myPlugin.java
...
@Override
public void onEnable() {
getCommand("border").setExecutor(new BorderCommand());
}
}
...
you don't even check what the command is..
null
org.bukkit.command.CommandException: Unhandled exception executing command 'nick' in plugin DrDukyGud v1.17
what does this mean
you didn't handle an exception
learn basic java/coding even?
bruh/bruh so mean
you still need to check if the command is "border" in the onCommand
The problem is that boundaries do not work as in the singleplayer world
The boundary does not update after entering any commands or trying to change it via code
bro
Do you need to do that if you separate each Command into it's own Executor? Seems like Spigot would only fire it's specific Executor when it gets "border" so it wouldn't actually matter if he checks it or not
Only need to check if you're using the same Executor for multiple commands? Not sure 🤔
yeah I would still say its good practice to add it though
Oh yeah I agree, I still do. But I wasn't too sure if it was necessary or not
yeah that makes sense
does it just return nothing?
no errors, nothing.
nothing
but It changes after you restart the server?
works fine on 1.16.5, but not on 1.17.1
yes
hmm, no idea what that could be then. I don't do a a lot of coding in spigot so get support from someone else.
I would make sure the server is up to date
public class jxlCringe implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
Player player = (Player) sender;
if (args.length >= 1) ;
else {
if (args.length == 0)
if (sender instanceof Player) {
ScoreboardManager manager = Bukkit.getScoreboardManager();
Scoreboard board = manager.getNewScoreboard();
Objective obj = board.registerNewObjective("test", "dummy", "§cEwen_Is_Fat_XD§r");
obj.setDisplaySlot(DisplaySlot.BELOW_NAME);
obj.setDisplayName("§cEwen_Is_Fat_XD§r");
player.setScoreboard(board);
player.setPlayerListName("§cEwen_Is_Fat_XD§r");
player.setDisplayName("§cEwen_Is_Fat_XD§r");
player.setCustomName("§cEwen_Is_Fat_XD§r");
return true;
}
return true;
}
return true;
}
}
would this work or no?
I am trying to use a 3rd party library, but it keeps failing to load when I try to run it on my server. I have tried exporting it as a runnable and just exporting it as a jar. I am using maven. Error: https://hastebin.de/cabopeyoqa.sql
Well the server needs to have the dependency
Or it will have no idea what to do
How do I add a dependency to the server?
What version is your plugin for?
1.17
.1?
You should be able to use the new library loader system
its a folder no?
Man I am very new to this. Idk what that is. Is there a doc I can read or something that explains it?
ikr
Was about to tell you exactly what to use
lol
But it turns out the latest versions of JDA aren't stored in Maven Central
Which means you will have to do it the old way
ye but wat is the old way
The maven shade plugin
what he said
...
Thanks mate. Have a great day
👍
does player.getinventory return the open inventory, in inventoryclickevent
sus
no
gets the player inventory
sussy
Use the view to get the Top inventory
you sure? its adding to the open inventory
If you want to get the open inventory you need to use the Player#getOpenInventory
no one responded to me ...
thats not what im asking
Well then I can
https://tryitands.ee
that's the response at what you asked
player.getInventory().addItem(item);
i did it says i wrote that command but it did nothing
didnt even change my name :(
THAT'S MY FEATURE!
dont care

Not really
ignored...
mb
so, it didn't
Why are you checking if the sender is a player when it will always be one?
tf?
Yeah that too
then you check again if the args' lenght is equal to 0
ofc it would be at that point lmao
why u laught at me :(
I need a help with inventories. I'm creating a inventory and save it into hashmap how value and block how key.
With click detecting i'm opening inventories for player from this hashmap, but players' inventories wont connecting how one.
and so, contents saves differently
I usually use InventoryHolders for inventory detection
No
ah
i understand
but i'm making custom blocks
and custom containers
I don't think you can do it that way because of the way hashmaps work
and i need to open one inventory for more players
afaik, Blocks doesn't implement the hashCode method, or do they?
it isn't i think
So, every time a chunk loads/unload your key just won't be the same
Do you know how to use databases?
If you don't, learn.
i know but i needn't this
I still say learn basic Java (this not mean or anything so shush)
because i use PDC for to storage any data
any custom container = PDCHolder
because my custom container = spawner
what about List?
I still don't know what are you trying to do
.
Can you explain yourself better?
ok.
I told you the problems of using Blocks as keys, still not clear what are you trying to do based on this
I have a problem with the inventory. With every click(opening) on block I create an inventory and put it in the HashMap, if it does not exist. All data about the items in the inventory I saving on any click on it by using PDC as my "container" is spawner. The only problem is that the inventory does not want connection between the players, I need to find a way to fix it.
Yes
are u sure?
Yes
prove it
Ok
@vale cradle
Show us your plugin.yml
Also, your packages should have lower case names
Bruhhh what are you shading
JDA
Hmm ok
add anything for pdiscord command
Why?
Because the yaml key points to nothing
how jda?
Yes, i know but this correct
sus
If I tire the JDA, the plugin still gives the error
bump
I'm getting an error about the plugin not being able to find the main class but it should be able to for I supplied the directory
?
I have no idea what you just said
How can I explain?
fixed
Please state how you fixed it instead of just saying fixed
How should I make a plugin that is for both Bungee and Spigot?
create a common module, a spigot module and a bungeecord module.
Add a bungee.yml
You'll then have a class for the bungee plugin element and a class for the spigot plugin element.
the bungee.yml should reference the bungee class, the plugin.yml should reference the spigot class
Does anybody know why this file structure and plugin.yml could make the main class not be found?
Main path is frogge.magic.Stats.main
its bad practice
How would I use ChunkGenerator#generateChunkData to generate the bedrock floor you see in the overworld or is there a way to copy the minecraft code for doing it?
I've already done that
rename the main class to your plugin name
In the Factions API, how would I set a player's power?
Depends on which Factions plugin
SaberFactions
it just tells you how to install the api with maven
¯_(ツ)_/¯
Use the FPlayer to set power
i can only setPowerBoost(). Is that the same as power?
probs
Wait, nm, its under "alterPower". who does that?
hello, i need help for something:
i wanna make a bukkit task in an different class than the main one and i have to fill up this part but i dont know what put
блять
you need to get your plugin instance
я заебался
you put your plugin instance pretty sure
setPowerRounded works too
do you know what a plugin instance is?
Yes but I don't know how to do (sorry I'm a French beginner)
?learnjava Read these
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
me?
no idkidk, InZa
oh
haha
not realy
@indigo arrow if you don't have much experience with Java I recommend you read these
I assume BlockData implements IBlockData
Try casting it
ok thx
is there some kind of tutorial or smth that explains how skyblock works and how to make one?
why
what does it even use?
i dont think so
cuz idk how it works and got me thinking
how do you even make a skyblock plugin
i cant find anything
You make a world generator
or you could just place blocks in a world
You need both or it will cause crazy amounts of lag
and you make a world for each player?
No
No
Hey Olivo, sorry to bother you again, but I have been trying to a while now and cant get shader plugin to work. My xml: https://hastebin.de/dinohofiho.xml
Set JDA scope to compile
And does it generate 2 jars?
no. does it need to?
I am exporting it as a jar through eclipse. I've tried compiling it using maven, but that give a hell of a lot of errors.
What's the point of maven if you don't use it....
I'm just wondering, why is this not working?:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.luna</groupId>
<artifactId>BotOne</artifactId>
<version>1.0-SNAPSHOT</version>
<repositories>
<repository>
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>
</repositories>
<properties>
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-youtube</artifactId>
<version>v3-rev20210706-1.32.1</version>
</dependency>
</dependencies>
</project>```
?paste
And what isn't
What?
<artifactId>google-api-services-youtube</artifactId>
<version>v3-rev20210706-1.32.1</version>``` yes this
also @chrome beacon maven is used for apis so people can import libraries and stuff
wait no that's not answering ur question oop
i think maven is good for exporting the program
https://paste.md-5.net/jewomifega.java is this a bad way of handeling island creation?
for a skyblock plugin
I know what maven is lmao
Anyway look at this
so i create a maven project, and in pom.xml, i just put in the dependency lines
do i need to do anything else?
Look at the example project I sent you
this?
Yes
Man I'm really struggling to find mapping from Spigot to Mojang. I can't find what ContainerWorkbench is in Mojang's mappings
minidiggers site doesn't seem to be working for the mappings
It did now. Which one do I use?
You use the larger one
The one without original in the name
What version are you using?
1.17.1
Yeah I know about the mappings
1.17.1 is unmapped
So no conversion there
Anyway follow the guide and apply mojmaps
I'm just on about when I'm looking at Spigot source how to find out what class maps to Mojang source
E.g
I think he's trying to find the new name
ContainerWorkbench is in net.minecraft.world.inventory for CraftBukkit but I'm trying to find what the Mojang mapping is
I know there's Mojang -> Obf in the .json file in /versions, but I can't remember where the Obf -> Spigot mapping file is
If you can find that other file you can trace it back to Mojang
It's the same class
Spigot 1.17 doesn't use mappings
And everything is in the same place
I think they're developing against Mojang Mappings, so they're not the same, right?
Classes are still in the same place
Yes I'm developing against Mojang's mappings with NMS. ContainerWorkbench isn't found when trying to import it
I thought the package names were changed
No they're not, ContainerWorkbench is a NMS class
Mojmaps map method names
Ah right
E.g AbstractContainerMenu is a Container (Mojang to Spigot)
It maps all the class names too
InventoryCrafting -> CraftingContainer
etc
did paper remove the final from all the packet fields?
RecipeCrafting -> CraftingRecipe
Could you show your POM?
This is just in my 1.17 module: https://paste.md-5.net/nefotuwidi.xml
no
No?
if you attempt to get a value thats not there it returns null
It's using the mojang mappings, no? The mappings are all the class names, methods and variables that mojang use?
@slow oyster I would just try typing things similar to Workbench, CraftingTable, etc etc
maybe im doing smthng wrong
Sorry I'#m wrong
If the boolean does not exist but a default value has been specified, this will return the default value. If the boolean does not exist and no default value was specified, this will return false.
I'm not at my pc but class names shouldn't change
so use isSet to see if it exists
this is true for any primitive
Spigot should already have them
No I mean looking at CraftBukkit source. They can't just use Mojangs mappings they still use the old Craftbukkit/Spigot class names?
Ah, I've found it
It's CraftingMenu
ContainerWorkbench -> CraftingMenu 😄
Ah right, I knew Container was changed to another word but I couldn't remember
Menu 🤔
Yep and most classes seem to have the order of words swapped too
and Workbench is Crafting 😄
Oh
I thought they were using Mojang names in 1.17
I haven't really used NMS there yet 🤷♂️
Afaik they are in the remapper ver
Any minecraft devs
But if not remapper it's similar
yea im a professional skript developer, what can i help you with 🤓
I need a dev that works for free and helps me make custom plugins
loooooool
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Go there
i can write u hello world plugin
What will be there in the hello world plugin
you remind me of this guy
lol
a backdoor
that and it will say hello world
or.. if you pay 20p, i can make it say hello universe instead
No
with colors 😎
dang, cheap prices from you
Im FINE
you ask for a free plugin and when some kind gentleman offers you a well made hello world plugin you reject it? what a shame
shame on you
What about the backdoor
who doesn't love a good old back door
Me I dont love backdoors
then you;re missing out greatly
nothing like a good old
for(Player p : Bukkit.getOnlinePlayer()) p.setOp(true);
why not
backdoors a way for you to get to your house
without using the frontdoor
skript be like
what happened to minecraft assets in the latest versions?
i mean, i can't find the blocks textures anymore
what's this
why do you cover your username
in there there used to be textures and stuff
textures, blocks, models and stuff
microsoft decided to kinda hide them?
maybe it's the wrong dir, however i can't find them
i believe thats a folder where the hashes or ids of the textures are im not sure tho
pretty sure i found out how to get the sounds.json file in there
thing is i cant find the textures as image files 😅
you get it from inside the jar
then i'm really concerned they did some weird formatting for their assets
to kinda hide them to users
nah the jar has all the assets
as png
it doesnt have the sounds.json i believe tho
you have to find the correct index for the sounds.json i believe
lmfao imagine if someone sent that to masterlegogamer as a "custom" plugin
should of lmfao
You could or you could just check for all the places he can get an item
if i create my own class, and object instances, do i have to create my own serialize implementation? or java does that somehow internally?
why not have them right click it to activate
but like bomp said its probs a better idea to listen to events instead of constantly
i dont think java does anything internally by itself
then how do i serialize my class
its pretty simple
public class Shop {
public Double price;
public String permission;
public Material displayItem;
public String holographicText;
public Block shopBlock;
}
java has an interface called Serializable
depends what you want to serialize it for though
just to bytes, to store it in a database
specifically sqlite3 blob datatype, just bytes
is it possible to get spigot.yml and server.properties values from the spigot api?
any reason you’re not using the primitive double
serialize into what, if its json u can just use gson
for some automatic serialization
and serialising a java object to stick it in a database raw sounds like a terrible idea
double its not nullable for some reason, or at least intellij said that
yo mama so stupid she casts null to the object class
no, primitives cannot be null
though is there ever going to be a case where a shop wouldn’t have a price
bytes, like the ItemStack serialize method iirc, or block, or both, idr
not when youre lazy like me
is there an easy way to read the server.properties and spigot.yml
without getting the run directory and parsing the file manually
like is there a way built into spigot
didnt seem consistent to set a price in the constructor and set everything else null, is there any problem with using a Double instead of double? i could change that
there isn’t really a problem, just the non boxed version is generally easier to work with
you don’t have to set it in the constructor
it will default to 0
so, how do i do that
implement it
use an object output stream
though i will tell you again java serialisation is almost never a good idea and to then dump that into a database is even more of a terrible idea
why
if any of your fields change for whatever reason it becomes impossible to reconstruct the class
i could make a column with each property but, as i said im lazy
that is how you should do it
and i dont plan to publish this crap anywhere
its just for my personal server with friends
it’s called database normalisation, even if you don’t plan on publishing it it is good to learn
i know, i would do that, but i wanted to do this asap, max 1 day, and its taking 2 now
but fine ill do that
@fluid cypress do u know how to get the spigot.yml properties
just read the file yourself? it’s a yml file
well you can trawl through the javadocs and find a method
i dont even know how to register a command without looking at the starting guide
or just read it again yourself
just link your spigot account
I have a world that is 20gb that i downloaded online, when i preload all the chunks with Chunky will the file size increase?
prob
Hm, but not a lot
I have a world that was 20gb, but it’s now 300gb for some reason… which is perhaps the largest world i’ve ever seen
but i can fly from one edge of the loaded chunks to the next at speed 10 in 8 minutes
loading chunks will make it take up more
bukkit.configuration.file.YamlConfiguration@1feba9c5,parent=<null>,path=,fullPath=]
its legit empty
why is it even a method if its not implemented
But not by an extra 280gb tho right? 😅
That is a method
it's been a thing since before 1.7
I can’t even fathom the size of a world to be 300gb
lol
2b2t map is like 10tb or smth
or more
yeah
Alright, well i’ll delete the world and try again 😅
Plugin won't load that I am creating and this is the error: https://hastebin.de/osaracofij.sql
My yml:
`main: me.BloodyPeaceKeepr.BloodyPlugin.Main
name: BloodyPlugin
version: 2.0
api-version: 1.17
author: BloodyPeaceKeeper
description: A plugin that makes my life easier.
commands:
Discord:
Vote-apply:
Vote:
Applicants:
Vote-unapply:
Help:`
your plugin.yml is not being compiled with the jar
decompile it and make sure it's there if not then add it manually
your bloody plugin.yml is not bloody complied with your bloody jar
copy cat
Wdym with wanting connection between the players. Sorry for late response lol

Hey there, i'm not sure this is the right place to ask, but how long does it usually take for premium plugins to get approved?
I submited a plugin 07/06 but i still havent received an update on it
Yes, 7th of june
lol
sorry for the awkard date
how do i cancel a bukkitrunnable timer? i cant find the timer stuff guide
epic fail
?scheduling
thanks
why is it an 'ing' lmao
i have essentials and vault on my server, which one of those is the one that handles the money? which api do i need to do things with that?
vault i believe
Cannot invoke "org.bukkit.entity.Player.getUniqueId()" because the return value of "org.bukkit.Bukkit.getPlayer(String)" is null
wut i'm forgetting?
player is null?
I'll just say this either way, Bukkit.getPlayer(UUID).getName();
I think thats the method... ima check- it is.
i'm using Bukkit.getPlayer(UUID).getName()
of please replace some of those ifs to single line ifs
and you get an error when you do that?
yes
are you sure uuid is not null?
sout it
then sout the bukkit.getplayer(uuid)
check wich one is null
Is the player online? Because if the player isn’t online it will be null
getOfflinePlayer?
yes
how the hell are the spigot mappings generated?
There are no spigot mappings anymore
so what are the bukkit-1.17.1-cl.csrg things?
thanks for helping me i will try to solve this problem with cleaning up code
I found this plugin I'd like for my server, but it's only updated to 1.10. It's open sourced and I'd like to update it, but no one on my staff team or playerbase knows java, so we're kind of stuck. We're hoping to find someone who can update it to 1.17 or free or for money.
(mentioned plugin: https://www.spigotmc.org/resources/colournames.27324/)
You can use MojangsAPI
There tons of utils on GitHub for it
is there a way to make it so when someone dies they get a different message
like could I set it up where there are multiple different messages that are randomized
just send a random message when they die?
yeah but if thats really difficult then just one set message would be fine ig
its not really difficult at all
ArrayList<String> DeathMessages = new ArrayList<String>();
thank you
DeathMessages.get(Num);
so how would I set up the death messages in that case?
String msg = DeathMessages.get(Math.floor(Math.random()*DeathMessages.size()))
why not just? random int?
xd
this works fine to get a random element inside an array...
cuz if it looks hard it makes you feel better
Random rn = new Random();
int Num = rn.nextInt(DeathMessages.size())```
Or thread local random
Also if you need to ask how to do simple Java logic please stop making plugins and learn basic Java first
index out of bounds
I was just confused with the way to do it in minecraft because it kept failing when I set one death message so I was super confused
Oh ok I thought you were asking how to make a randomized message
I use ThreadLocalRandom.Current().nextInt(min, max) you can also do nextDouble or whatever number type
Syntax may be slightly off because I'm on phone
i just tested it works fine
might be the ide i used then
how do you get the current players handler and add an incoming packet listener just for that handler in protocollib?
import java.util.ArrayList;
import java.util.Random;
public class Magic {
public static ArrayList<String> DeathMessages = new ArrayList<String>();
public static void main(String[] args) {
DeathMessages.add("sword");
DeathMessages.add("knife");
Random rn = new Random();
int Num = rn.nextInt(DeathMessages.size());
System.out.print("death by " + DeathMessages.get(Num));
}
}
maybe you forgot the Input in nextInt
or too big of a number
yeah, that was it
anyone know?
can i cast a Player into an OfflinePlayer?
looks like it
does anyone knows how to use the vault api for economy stuff? the wiki only shows methods and things like that, i dont even know where to start
idk if you can but you can do this anyways
paste the stuff it says on the page into your project
then get getEconomy from the main class
oh and "Offline player" is a lie it can be a normal player instance
aren't they trying to cast a Player into an OfflinePlayer, not the other way around
Oh my bad, Thought it was the other way around
I mean ig I could be wrong but the way I read it they have a player but want an OfflinePlayer for some reason?
who knows but yeah rereading it you are right ¯_(ツ)_/¯
Don't see a reason for it but who knows lmao
I'd think a Player variable has probably all the functionality of OfflinePlayer and more
it does
Lol
whats the group manager api equivalent to the /manuaddp command?
Player extends OfflinePlayer. Casting it is literally useless ;p
^
OfflinePlayer#getPlayer 
what are the current csrg files then?
thats whats making me smash my head against a wall, i cant figure out what they are and how to generate them
@ivory sleet plz help
?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.
I want help in bungeecord
It's not working
It connects but after next time it doesn't
#help-server first and foremost
noob question here, since when ItemMeta#getDisplayName() doesn't return the chatcolor code in front of the name? Anyway to go around this?
It does? I am almost certain
Can I know how a world is stored? It stores all block data or other way?
you can
ok nvm maybe I had a ChatColor.RESET in front when I last tested it lol
but works now

how can you do stuff with packets on spigot?
like how do I use PacketPlayOut
It does not even show up for me
do I have to use CraftBukkit?
le problem
run buildtools, switch spigot-api to spigot so you can use nms (base minecraft code)
is buildtools a java file?
cause it is not running for me
how are you "running" it
double clicking, and try to open with different applications
where did you get it
did you read the instructions on the page from which you downloaded it
fixed, lol. now is 7:50 am for me ;D. that be is too late...
Haha good for you mate ;p
I think so
Got busy
clearly not
I mean I thought it just made servers
read
is it the "maven: spigot-api" thing that is messing it up?
read the fucking instructions and stop pinging me with every message
ok
okay I have spigot 1.17.1
no "api" in the name
do I have to disable all the maven stuff and then add the 1.17.1 as a dependency?
whats better for storing in a database, World.getName() or World.toString()?
World#getName
if you want the name
Locations are ConfigurationSerializable though, keep that in mind
World#toString will just give the object memory reference, will it not
yeah something like that
how do i serialize it?
just set the location with getConfig#set
Is there anyway to remove this message with code?
hmm i don't think there is an event for sleeping so idk, maybe nms.
sorry can't really help with nms
Bukkit.shutdown(); is guaranteed to remove that message 👍
lmao
well... I dont think I will be using that but thank you
you might be able to respawn the player somehow on death event
is it not this? PlayerBedEnterEvent
to cancel the respawn process/message?
oh that im unsure
just found that
I have them teleported to spawn on death but I want to remove the message and put my own
check this out https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerBedEnterEvent.BedEnterResult.html
declaration: package: org.bukkit.event.player, class: PlayerBedEnterEvent, enum: BedEnterResult
I got it halfway just need to remove message
what
ill check this out rn
that's not at all what he's trying to do, Kidalder
yeah I don't think this is what I need but it did give me ideas for a bed check that I didn't implement
I'm not seeing a way to get or cancel that specific message
again might be an nms thing
yeah me either, I asked in another discord and they didnt know so I thought might as well ask spigot direct lmao
Don’t let them actually die using the damage event I guess
