#help-development

1 messages · Page 1574 of 1

ivory sleet
#

I believe its called NbtCompound

#

not sure actually

chrome beacon
#

Isn't it CompoundNBT?

urban lava
#

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

chrome beacon
#

Yes

ivory sleet
#

olivo might be that

#

I am used to yarn mappings lol

paper crest
chrome beacon
#

I use Mojmaps for Forge so it might be the same

hasty prawn
#

Props to you for trying to understand why something works before pasting it in btw Epic

ivory sleet
#

hmm yeah Olivo it seems to be that

chrome beacon
#

This is why Mojmaps are great

#

Since everyone is starting to use them it's the same everywhere

ivory sleet
#

idk

#

yarn mappings is just superior

urban lava
ivory sleet
#

for instance params

chrome beacon
#

Yeah params...

ivory sleet
#

Yes PaRaMs!

chrome beacon
#

They're missing but you can generally figure out what you need

#

If not you look up the MCP mappings

ivory sleet
#

its slightly counter intuitive to work with param_2139012lol

#

or smtng

paper crest
#

also why net.minecraft package is removed?

chrome beacon
#

They're not

#

That would mean you forgot to import NMS

urban lava
#

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

paper crest
#

im using maven is there any extra dependency for this?

urban lava
#

now the plugin won't load

eternal oxide
urban lava
#

and idk how to fix it

quaint mantle
#

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();
                }
eternal oxide
#

?paste

undone axleBOT
hidden delta
chrome beacon
#

ArrayOutOfBounds

#

.-.

quaint mantle
#

ik

hidden delta
#

you need to use add not set!!

quaint mantle
#

Ok thanks!

hidden delta
#

wait!

#

can you join general-1?

quaint mantle
#

cant voice
but it need be add(int,string)?

hidden delta
#

you will just hear me

#

you don't need to speak

quaint mantle
#

ok wait

ivory sleet
#

I want to hear this wonderful speech

urban lava
#

@ivory sleet the Damageable damageable part shows an error saying that pattern matching instanceof expressions is only available with source 16 and above

ivory sleet
#

then dont use it

#

just cast it once instanceof checked

urban lava
#

wait lemme think abt this

#

i dont wanna have olivo out here with a spoon

ivory sleet
#

no worries, he's busy coding

urban lava
#

well i dont know what variable i would use isntread of damgeable

#

would i use like

#

(Damageable) meta

chrome beacon
urban lava
#

noooooo

ivory sleet
#

Damageable damageable = (Damageable) meta;

urban lava
#

ohhhhhhhhhhhhh

ivory sleet
#

basic java ma'am

urban lava
#

im stupid

ivory sleet
urban lava
#

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

eternal oxide
#

you shoudl be able to use setItemMeta(damageable)

urban lava
#

no cuz its a Damageable type

#

yeah it thorws an error

eternal oxide
#

cast it back then

#

setItemMeta( (ItemMeta) damageable )

#

or I'm having a brain fart

chrome beacon
#

Using meta should work just fine

urban lava
#

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);
                }
            }
chrome beacon
#

Why are you checking if the damage is 0 and then setting it back to 0?

urban lava
#

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

chrome beacon
#

What event are you using?

#

(or where is that called)

urban lava
#

PlayerDamageItemEvent

#

ItemDmaage

#

Oops

eternal oxide
#

You want to check event.getDamage() and just cancel the event if your item is full health

urban lava
#

PlayerItemDamageEvent

urban lava
#

i've tested it

eternal oxide
#

No, thats the amount of damage the tool will take

chrome beacon
#

Use the event methods yeah

urban lava
#

wait

chrome beacon
#

If you want to remove all damage cancel the event

urban lava
#

oh

#

how do i cancel

chrome beacon
#

?eventapi

undone axleBOT
eternal oxide
#

so check durability of your item, if 0 cancel the event

urban lava
#

oops

tardy delta
#

hi does inventory.setExtraContents() adds the items to a free hotbar slot and then to the inventory itself?

chrome beacon
#

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()

urban lava
#

nice it works ty

#

to everyone who helped

untold rover
#

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.

potent pecan
#

is there a way to prevent farmland transforming in dirt (when there isn't any water) ?

chrome beacon
untold rover
#

because the player is removed from the tablist

vestal moat
#

CommandSender#getName returns CONSOLE if its console sender?

chrome beacon
untold rover
#

well then the players are invisible

chrome beacon
#

They're not

#

I literally just did this today

untold rover
#

Okay so I listen to the Player Info Packet and then just send the remove packet?

chrome beacon
#

Yes

untold rover
#

could you give me an example? because when we removed them from the tablist the players aren't getting rendered anymore

chrome beacon
#

First off what version are you on?

#

(Minecraft)

untold rover
#

1.16.4/5

chrome beacon
#

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

untold rover
#

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.

steep nova
#

How can I slow down the hunger of a specific player?

untold rover
bitter ridge
#

You can't remove pathfinding for withers?
or what is happening?

chrome beacon
untold rover
chrome beacon
#

It rendered just fine for me

untold rover
#

even if you get out of the players render distance?

chrome beacon
#

Maybe because we were right next to eachother to begin with

untold rover
#

can you try to run away from each other until you despawn and then get back together

chrome beacon
#

Hm I guess

untold rover
chrome beacon
#

Yeah that too

steep nova
#

Let's say I want to slow down the hunger 2x, how do I cancel the event every other time?

sharp bough
#

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

steep nova
#

i don't want to modify saturation, i want to modify how quickly the hunger bar goes down when saturation is 0

chrome beacon
#

Player dissapears if you go out of range and come back again

full holly
#

how can I create a sign where I can write in for example a player name? IN 1.8.9

chrome beacon
#

Like a menu?

full holly
#

yea

chrome beacon
#

NMS and packets

full holly
#

and how=

sharp bough
#

i think you have to use the state

#

of the sign

full holly
#

I found nothing

sharp bough
chrome beacon
#

Not what he's asking

#

Anyway I generally don't support 1.8

full holly
#

I can open signs, but I cant get the text or make a sign with text inside

full holly
#

its possible

chrome beacon
#

and?

full holly
#

but how?

chrome beacon
#

This has nothing to do with what I said

#

I never said it doesn't work

sharp bough
#

XD

full holly
#

xD

steep nova
#

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?

chrome beacon
sharp bough
#

or long idk

chrome beacon
#

Probably don't need a long

steep nova
#

interesting, ill look into that

#

ty

pallid arrow
#

how to make custom id for custom item?

ivory sleet
#

how about you elaborate a little more

untold rover
chrome beacon
steep nova
#

uuid is a built in java class?

chrome beacon
#

Yes

young knoll
#

yes

steep nova
#

kk

untold rover
chrome beacon
#

Well try cancelling the add packet and resend it after you send the player packet

untold rover
#

the add packet is important, if the player is not in the tablist the client doesn't render players

#

thats why they stay invisible

bitter ridge
#

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

ivory sleet
#

pretty sure it has a goalselector like most creatures

#

or "mobs"

chrome beacon
restive burrow
#

yo gamers whats the bungeecord forwarding contents of C01 again?

chrome beacon
#

Cancel it add player to tab and then resend it

restive burrow
#

in the ip field

untold rover
restive burrow
#

and what seperator

untold rover
chrome beacon
#

You can work around that

quaint mantle
#

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

ivory sleet
#

nms

quaint mantle
#

Well yes but what

restive burrow
#

\u0000 right?

ivory sleet
#

easiest way would be to change to inject an adapter goal to their goal selector

untold rover
chrome beacon
quaint mantle
#

Haven't done much with goals

untold rover
chrome beacon
#

Do what I said and add a simple check to prevent stackoverflows and see if that works

untold rover
#

well what should I check for?

ivory sleet
#

oh right skeagle, it might be hard then

chrome beacon
#

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

vital ridge
#

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

quaint mantle
#

how to get a supergoldenapple on a sell / buy sign? (Enchanted_Golden_Apple) is to long to get on the sign.

vital ridge
#

I know they had some fcked up itemdbs

#

But in 1.16.5, the itemdb is just RED_WOOL

ivory sleet
#

wait RED_WOOL exists?

#

no

#

?

vital ridge
#

Same with dyes

#

Well for an example

#

If i use red_dye

ivory sleet
#

sounds like you're using a legacy version

eternal oxide
#

RED_WOOL is a valid Material enum in 1.16.5

vital ridge
#

yea it spits some bs about legacy

#

what is legacy tho?

eternal oxide
#

api version in your plugin.yml

vital ridge
#

But if i were to add api-version 1.13

#

1.8 players

#

will be stuck

eternal oxide
#

no

ivory sleet
#

1.13 < is mostly considered legacy like actual legacy versions

eternal oxide
#

the entry is ignored pre 1.13

vital ridge
#

Wait

#

so what does legacy mean

#

in general

chrome beacon
#

It means the plugin was made for an old version pre 1.13 with old material ids

quaint mantle
#

how to get a supergoldenapple on a sell / buy sign? (Enchanted_Golden_Apple) is to long to get on the sign.

vital ridge
#

But my plugin is 1.16.5?

#

So some thing doesnt know that if i dont specify the api-version?

chrome beacon
vital ridge
#

Okay gotchu

#

So legacy basically means that this plugin is older than 1.13?

#

If i were to say legacy 1.13

ivory sleet
#

no

#

I mean we talk about it more as a flag

#

like does the plugin support legacy versions?

vital ridge
#

Okay so

#

So 1.13 is legacy, cuz it is compatitable with other versions?

#

I mean some other

ivory sleet
#

no

chrome beacon
#

pre 1.13 is legacy since in 1.13 item ids changed

ivory sleet
#

its just an old version

vital ridge
#

Okay so its kinda timestamp?

#

legacy is under 1.13?

ivory sleet
#

no its if the version is namespace based or id based

#

yes

vital ridge
#

And where it stops

#

in 1.8 right

#

1.7.9 is like ancient

ivory sleet
#

no it goes down all the way to like pre 1.0.0

quaint mantle
#

can you store custom nbt data in an ItemStack and then have your plugin handle any ItemStack with said custom field?

ivory sleet
#

yes precisely

#

although keys are namespaced

vital ridge
#

So whats higher than 1.13 considered?

ivory sleet
#

not legacy

#

Higher than 1.12.2 that is

vital ridge
#

Aight

dawn phoenix
#

Is there a way to make it look like the player is carrying a backpack without nms usage?

chrome beacon
#

Where would that backpack be?

dawn phoenix
#

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?

chrome beacon
#

You can use CustomModelData on a chest plate to get the backpack to look good

dawn phoenix
#

@ashen flicker is assisting with this... @chrome beacon not wanting to use any custom textures

chrome beacon
#

Well then lagging behind the player is the only way

dawn phoenix
#

Hmm

robust jolt
#

How i can find the config path of my plugin?

hasty prawn
#

getDataFolder()

robust jolt
#

this?

quaint mantle
#

no

#

getDataFolder()

hasty prawn
#

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()

robust jolt
#

else?

hasty prawn
#

Just get your plugin instance and call getDataFolder on that

robust jolt
#

ok, thanks

quaint mantle
#

Persistent Data Container

eternal oxide
#

?pdc

quaint mantle
#

ah ok thanks

chrome beacon
#

Ah yeah I forgot about that

valid delta
#

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)

reef wind
#

what does that have to do with plugin-development?

#

and bukkit

valid delta
#

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

reef wind
#

so it does change when you restart the server?

valid delta
#

Yes

#

But not during the game

reef wind
#

and your problem Is that /worldboarder get doesn't output anything?

reef wind
valid delta
#

The problem is that the boundary does not change, either through commands or code

reef wind
#

where do you have your code located?

#

@valid delta

valid delta
#
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());
  }
}
...
reef wind
#

you don't even check what the command is..

robust crypt
#

null
org.bukkit.command.CommandException: Unhandled exception executing command 'nick' in plugin DrDukyGud v1.17

#

what does this mean

reef wind
#

you didn't handle an exception

robust crypt
#

wat

#

wdym

reef wind
#

learn basic java/coding even?

robust crypt
#

bruh/bruh so mean

reef wind
valid delta
#

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

reef wind
#

bro

hasty prawn
#

Only need to check if you're using the same Executor for multiple commands? Not sure 🤔

reef wind
#

yeah I would still say its good practice to add it though

hasty prawn
#

Oh yeah I agree, I still do. But I wasn't too sure if it was necessary or not

reef wind
#

no errors, nothing.

valid delta
#

nothing

reef wind
#

but It changes after you restart the server?

valid delta
#

works fine on 1.16.5, but not on 1.17.1

valid delta
reef wind
#

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.

chrome beacon
#

I would make sure the server is up to date

robust crypt
#
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?

real spear
#

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

chrome beacon
#

Or it will have no idea what to do

real spear
#

How do I add a dependency to the server?

chrome beacon
#

What version is your plugin for?

real spear
robust crypt
#

.1?

chrome beacon
#

You should be able to use the new library loader system

robust crypt
real spear
robust crypt
#

ikr

chrome beacon
robust crypt
#

lol

chrome beacon
#

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

robust crypt
#

ye but wat is the old way

chrome beacon
#

The maven shade plugin

real spear
robust crypt
#

...

chrome beacon
#

Have patience I'm looking up links for you

#

There you go

real spear
#

Thanks mate. Have a great day

robust crypt
#

👍

quaint mantle
#

does player.getinventory return the open inventory, in inventoryclickevent

robust crypt
#

sus

vale cradle
#

gets the player inventory

robust crypt
#

sussy

chrome beacon
#

Use the view to get the Top inventory

quaint mantle
#

you sure? its adding to the open inventory

vale cradle
#

If you want to get the open inventory you need to use the Player#getOpenInventory

robust crypt
chrome beacon
vale cradle
quaint mantle
robust crypt
#

didnt even change my name :(

quaint mantle
robust crypt
#

dont care

quaint mantle
chrome beacon
robust crypt
#

ignored...

quaint mantle
vale cradle
robust crypt
#

yes it didnt

#

u got it right

#

idk whats wrong tho

chrome beacon
#

Why are you checking if the sender is a player when it will always be one?

vale cradle
chrome beacon
#

Yeah that too

vale cradle
#

then you check again if the args' lenght is equal to 0

#

ofc it would be at that point lmao

robust crypt
#

why u laught at me :(

quaint mantle
#

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

chrome beacon
#

I usually use InventoryHolders for inventory detection

quaint mantle
#

hm?

#

I need to storage InventoryHolder, not Inventory?

chrome beacon
#

No

quaint mantle
#

i understand

#

but i'm making custom blocks

#

and custom containers

robust crypt
vale cradle
quaint mantle
#

and i need to open one inventory for more players

vale cradle
#

afaik, Blocks doesn't implement the hashCode method, or do they?

quaint mantle
vale cradle
#

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.

quaint mantle
#

i know but i needn't this

reef wind
#

I still say learn basic Java (this not mean or anything so shush)

vale cradle
#

Then, if you want to make an storage system, it won't be persistent

#

Same as nothing

quaint mantle
#

because i use PDC for to storage any data

quaint mantle
#

because my custom container = spawner

vale cradle
#

I still don't know what are you trying to do

vale cradle
#

Can you explain yourself better?

quaint mantle
#

ok.

vale cradle
robust crypt
#

....

#

bruh

quaint mantle
robust crypt
#

really.

#

are those in your jar file?

floral flare
robust crypt
#

are u sure?

floral flare
robust crypt
#

prove it

floral flare
#

Ok

opal juniper
#

Show us your plugin.yml

#

Also, your packages should have lower case names

#

Bruhhh what are you shading

floral flare
opal juniper
#

Hmm ok

quaint mantle
#

add anything for pdiscord command

opal juniper
#

The second command

#

Is the issue

#

Yeah

#

IntelliJ literally marked it as an issue

floral flare
opal juniper
#

Because the yaml key points to nothing

chrome beacon
#

Well jda is null

#

How much Java do you know?

quaint mantle
#

how jda?

floral flare
robust crypt
#

sus

floral flare
#

If I tire the JDA, the plugin still gives the error

novel lodge
#

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

chrome beacon
#

I have no idea what you just said

floral flare
#

How can I explain?

chrome beacon
#

jda can't be null

#

Fix it

novel lodge
#

Please state how you fixed it instead of just saying fixed

dusty sphinx
#

How should I make a plugin that is for both Bungee and Spigot?

proper notch
#

create a common module, a spigot module and a bungeecord module.

chrome beacon
proper notch
#

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

novel lodge
#

Does anybody know why this file structure and plugin.yml could make the main class not be found?

granite stirrup
#

is plugin.yml in src/main/resources?

#

also dont name the main class main

quaint mantle
quaint mantle
#

🙂

granite stirrup
sly bison
#

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?

quaint mantle
#

aw

#

Rename it

#

To FroggeMagic?

novel lodge
granite stirrup
mossy blaze
#

In the Factions API, how would I set a player's power?

novel lodge
#

Apparently it wasn't packaging the file correctly

#

I just did a clean and it worked

chrome beacon
mossy blaze
granite stirrup
mossy blaze
#

it just tells you how to install the api with maven

granite stirrup
#

¯_(ツ)_/¯

chrome beacon
mossy blaze
granite stirrup
#

probs

mossy blaze
indigo arrow
#

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

pallid arrow
#

блять

sharp bough
pallid arrow
#

я заебался

granite stirrup
chrome beacon
sharp bough
#

do you know what a plugin instance is?

indigo arrow
#

Yes but I don't know how to do (sorry I'm a French beginner)

chrome beacon
#

?learnjava Read these

undone axleBOT
granite stirrup
sharp bough
#

no idkidk, InZa

granite stirrup
#

oh

sharp bough
#

haha

indigo arrow
#

not realy

sharp bough
#

ik you know what a plugin instance

#

is

chrome beacon
#

I assume BlockData implements IBlockData

#

Try casting it

indigo arrow
#

ok thx

sharp bough
#

is there some kind of tutorial or smth that explains how skyblock works and how to make one?

granite stirrup
#

why

sharp bough
#

what does it even use?

granite stirrup
#

i dont think so

sharp bough
#

cuz idk how it works and got me thinking

#

how do you even make a skyblock plugin

#

i cant find anything

chrome beacon
#

You make a world generator

granite stirrup
chrome beacon
sharp bough
chrome beacon
#

No

sharp bough
#

doesnt that lag the shit out of the server on reload?

#

or start

chrome beacon
#

No

granite stirrup
#

you make just one world lmao

#

not 50

real spear
chrome beacon
#

And does it generate 2 jars?

real spear
chrome beacon
#

Yeah it should do that

#

How are you building the plugin?

real spear
chrome beacon
novel zodiac
#

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>```
chrome beacon
#

?paste

undone axleBOT
novel zodiac
chrome beacon
#

And what isn't

novel zodiac
#

What?

chrome beacon
#

What isn't working

#

The dependency?

novel zodiac
#
            <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

sharp bough
#

for a skyblock plugin

novel zodiac
#

well

#

having a world for every single island is laggy and takes up a lot of memory

chrome beacon
#

Anyway look at this

novel zodiac
#

no but in general,

#

i always have problems putting in dependencies

chrome beacon
#

I never have any problems

#

It's quite easy to find what exists

novel zodiac
#

so i create a maven project, and in pom.xml, i just put in the dependency lines

#

do i need to do anything else?

chrome beacon
#

Well you might need a repo

#

Other than that nothing else

novel zodiac
#

i have a repo

#

is this correct tho?:

chrome beacon
#

Look at the example project I sent you

chrome beacon
#

Yes

novel zodiac
#

ohh i see now thanks

#

is see the pom example

slow oyster
#

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

real spear
chrome beacon
#

The one without original in the name

chrome beacon
slow oyster
#

1.17.1

chrome beacon
#

Oh look at the 1.17 release post

#

It tells you how to use mojmaps

slow oyster
#

Yeah I know about the mappings

chrome beacon
#

1.17.1 is unmapped

#

So no conversion there

#

Anyway follow the guide and apply mojmaps

slow oyster
#

I'm just on about when I'm looking at Spigot source how to find out what class maps to Mojang source

#

E.g

hasty prawn
#

I think he's trying to find the new name

slow oyster
#

ContainerWorkbench is in net.minecraft.world.inventory for CraftBukkit but I'm trying to find what the Mojang mapping is

hasty prawn
#

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

chrome beacon
#

Spigot 1.17 doesn't use mappings

#

And everything is in the same place

hasty prawn
#

I think they're developing against Mojang Mappings, so they're not the same, right?

chrome beacon
#

Classes are still in the same place

slow oyster
#

Yes I'm developing against Mojang's mappings with NMS. ContainerWorkbench isn't found when trying to import it

hasty prawn
#

I thought the package names were changed

slow oyster
#

No they're not, ContainerWorkbench is a NMS class

chrome beacon
#

Mojmaps map method names

hasty prawn
#

Ah right

slow oyster
#

E.g AbstractContainerMenu is a Container (Mojang to Spigot)

#

It maps all the class names too

#

InventoryCrafting -> CraftingContainer

#

etc

granite stirrup
#

did paper remove the final from all the packet fields?

slow oyster
#

RecipeCrafting -> CraftingRecipe

chrome beacon
#

Could you show your POM?

slow oyster
chrome beacon
#

I see

#

Classes should use Vanilla names

#

And locations

somber hull
#

In a config

#

If a boolean is false

#

is it just non-existant?

#

In the config

eternal oxide
#

no

chrome beacon
#

No?

somber hull
#

Hmmm

#

ok

eternal oxide
#

if you attempt to get a value thats not there it returns null

slow oyster
#

It's using the mojang mappings, no? The mappings are all the class names, methods and variables that mojang use?

somber hull
#

Well its not doing that..

#

Hang on

hasty prawn
#

@slow oyster I would just try typing things similar to Workbench, CraftingTable, etc etc

somber hull
#

maybe im doing smthng wrong

eternal oxide
#

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.

chrome beacon
eternal oxide
#

so use isSet to see if it exists

unreal quartz
chrome beacon
#

Spigot should already have them

slow oyster
#

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 😄

hasty prawn
#

Ah right, I knew Container was changed to another word but I couldn't remember

#

Menu 🤔

slow oyster
#

Yep and most classes seem to have the order of words swapped too

#

and Workbench is Crafting 😄

chrome beacon
#

Oh

#

I thought they were using Mojang names in 1.17

#

I haven't really used NMS there yet 🤷‍♂️

dusk flicker
#

Afaik they are in the remapper ver

vivid gazelle
#

Any minecraft devs

dusk flicker
#

But if not remapper it's similar

dusk flicker
#

Basically everyone here is

sharp bough
vivid gazelle
#

I need a dev that works for free and helps me make custom plugins

sharp bough
#

loooooool

dusk flicker
#

?services

undone axleBOT
dusk flicker
#

Go there

unreal quartz
vivid gazelle
#

What will be there in the hello world plugin

sharp bough
#

you remind me of this guy

vivid gazelle
#

lol

sharp bough
unreal quartz
vivid gazelle
#

lmao

#

No thanks

unreal quartz
#

or.. if you pay 20p, i can make it say hello universe instead

vivid gazelle
#

No

sharp bough
#

with colors 😎

hasty prawn
vivid gazelle
#

Im FINE

sharp bough
# vivid gazelle 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

vivid gazelle
#

What about the backdoor

unreal quartz
#

who doesn't love a good old back door

vivid gazelle
#

Me I dont love backdoors

unreal quartz
#

then you;re missing out greatly

sharp bough
#

nothing like a good old
for(Player p : Bukkit.getOnlinePlayer()) p.setOp(true);

sharp bough
#

backdoors a way for you to get to your house

#

without using the frontdoor

vivid gazelle
#

Im not dumb I watch fitmc videos LOL

#

Ok bye

halcyon rapids
#

what happened to minecraft assets in the latest versions?

#

i mean, i can't find the blocks textures anymore

#

what's this

sharp bough
#

why do you cover your username

halcyon rapids
#

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

granite stirrup
# halcyon rapids

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

halcyon rapids
#

thing is i cant find the textures as image files 😅

granite stirrup
#

you get it from inside the jar

halcyon rapids
#

then i'm really concerned they did some weird formatting for their assets

#

to kinda hide them to users

granite stirrup
#

nah the jar has all the assets

#

as png

#

it doesnt have the sounds.json i believe tho

halcyon rapids
#

ok, i can confirm

#

nice

#

woah, what a fright :S

granite stirrup
#

you have to find the correct index for the sounds.json i believe

formal egret
sharp bough
#

i was about to

#

but felt bad abt it

formal egret
#

should of lmfao

drowsy helm
#

how often is "constantly"

#

but in most cases, no

quaint mantle
#

You could or you could just check for all the places he can get an item

fluid cypress
#

if i create my own class, and object instances, do i have to create my own serialize implementation? or java does that somehow internally?

drowsy helm
#

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

sharp bough
fluid cypress
#

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;
}
drowsy helm
#

java has an interface called Serializable

#

depends what you want to serialize it for though

fluid cypress
#

just to bytes, to store it in a database

#

specifically sqlite3 blob datatype, just bytes

restive burrow
#

is it possible to get spigot.yml and server.properties values from the spigot api?

unreal quartz
#

any reason you’re not using the primitive double

restive burrow
#

for some automatic serialization

unreal quartz
#

and serialising a java object to stick it in a database raw sounds like a terrible idea

fluid cypress
restive burrow
#

yo mama so stupid she casts null to the object class

unreal quartz
#

no, primitives cannot be null

#

though is there ever going to be a case where a shop wouldn’t have a price

restive burrow
fluid cypress
restive burrow
#

nah srsly tho

#

eh

restive burrow
#

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

fluid cypress
unreal quartz
#

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

fluid cypress
unreal quartz
#

implement it

fluid cypress
#

ok

#

and then

#

what do i do to get the byte array

unreal quartz
#

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

fluid cypress
#

why

unreal quartz
#

if any of your fields change for whatever reason it becomes impossible to reconstruct the class

fluid cypress
#

i could make a column with each property but, as i said im lazy

unreal quartz
#

that is how you should do it

fluid cypress
#

and i dont plan to publish this crap anywhere

#

its just for my personal server with friends

unreal quartz
#

it’s called database normalisation, even if you don’t plan on publishing it it is good to learn

fluid cypress
#

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

restive burrow
#

@fluid cypress do u know how to get the spigot.yml properties

unreal quartz
#

just read the file yourself? it’s a yml file

restive burrow
#

its already been parsed tho

#

so theres gotta be a better way

unreal quartz
#

well you can trawl through the javadocs and find a method

fluid cypress
unreal quartz
#

or just read it again yourself

restive burrow
#

why are u verified then

#

tf

fluid cypress
#

just link your spigot account

restive burrow
#

found it myself by thinkin logically

#

in case anyone else needs

#

:really:

unreal quartz
#

lmfao

#

hf

junior breach
#

I have a world that is 20gb that i downloaded online, when i preload all the chunks with Chunky will the file size increase?

dusk flicker
#

prob

junior breach
#

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

crude charm
restive burrow
#

bukkit.configuration.file.YamlConfiguration@1feba9c5,parent=<null>,path=,fullPath=]

#

its legit empty

#

why is it even a method if its not implemented

junior breach
crude charm
#

it's been a thing since before 1.7

junior breach
#

I can’t even fathom the size of a world to be 300gb

crude charm
#

2b2t map is like 10tb or smth

#

or more

junior breach
#

Yea but they reach the border of the world, and the whole world

#

right?

crude charm
#

yeah

junior breach
#

Alright, well i’ll delete the world and try again 😅

real spear
#

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:`

crude charm
#

decompile it and make sure it's there if not then add it manually

unreal quartz
#

your bloody plugin.yml is not bloody complied with your bloody jar

vale cradle
unreal quartz
next furnace
#

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

unreal quartz
#

is that 7th june

#

or 6th july

next furnace
#

Yes, 7th of june

unreal quartz
#

lol

next furnace
#

sorry for the awkard date

fluid cypress
#

how do i cancel a bukkitrunnable timer? i cant find the timer stuff guide

dusk flicker
#

?scheduler

#

?schedular

#

uhh 1s

unreal quartz
#

epic fail

dusk flicker
#

?scheduling

undone axleBOT
fluid cypress
#

thanks

dusk flicker
#

why is it an 'ing' lmao

fluid cypress
#

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?

sharp bough
#

vault i believe

round finch
#

Cannot invoke "org.bukkit.entity.Player.getUniqueId()" because the return value of "org.bukkit.Bukkit.getPlayer(String)" is null
wut i'm forgetting?

sharp bough
#

player is null?

round finch
#

i'm trying to convert UUID to name

#

but i'm getting null

dusk flicker
#

show code

#

in a paste

#

?paste

undone axleBOT
dusk flicker
#

I'll just say this either way, Bukkit.getPlayer(UUID).getName();

#

I think thats the method... ima check- it is.

round finch
#

i'm using Bukkit.getPlayer(UUID).getName()

sharp bough
#

of please replace some of those ifs to single line ifs

sharp bough
round finch
#

yes

sharp bough
#

are you sure uuid is not null?

#

sout it

#

then sout the bukkit.getplayer(uuid)

#

check wich one is null

quaint mantle
round finch
#

i need a offline name

#

from uuid

#

brb

sharp bough
#

getOfflinePlayer?

round finch
#

yes

quaint mantle
#

how the hell are the spigot mappings generated?

ivory sleet
#

There are no spigot mappings anymore

quaint mantle
#

so what are the bukkit-1.17.1-cl.csrg things?

round finch
#

thanks for helping me i will try to solve this problem with cleaning up code

quaint mantle
#

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/)

quaint mantle
#

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

round finch
#

ArrayList<String> DeathMessages = new ArrayList<String>();

quaint mantle
#

thank you

round finch
#

DeathMessages.get(Num);

quaint mantle
#

so how would I set up the death messages in that case?

#

String msg = DeathMessages.get(Math.floor(Math.random()*DeathMessages.size()))

round finch
#

why not just? random int?

sharp bough
#

xd

quaint mantle
sharp bough
#

cuz if it looks hard it makes you feel better

round finch
#
 Random rn = new Random();
int Num = rn.nextInt(DeathMessages.size())```
unkempt peak
#

Or thread local random

round finch
#

that new for me

unkempt peak
quaint mantle
sharp bough
#

in minecraft?

#

what were you using? terraria?

unkempt peak
unkempt peak
#

Syntax may be slightly off because I'm on phone

round finch
quaint mantle
#

might be the ide i used then

restive burrow
#

how do you get the current players handler and add an incoming packet listener just for that handler in protocollib?

round finch
#
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));
    }

}
round finch
#

or too big of a number

quaint mantle
fluid cypress
#

can i cast a Player into an OfflinePlayer?

shut field
fluid cypress
#

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

shut field
crude charm
#

then get getEconomy from the main class

#

oh and "Offline player" is a lie it can be a normal player instance

shut field
#

aren't they trying to cast a Player into an OfflinePlayer, not the other way around

dusk flicker
#

Oh my bad, Thought it was the other way around

shut field
dusk flicker
#

who knows but yeah rereading it you are right ¯_(ツ)_/¯

#

Don't see a reason for it but who knows lmao

shut field
#

I'd think a Player variable has probably all the functionality of OfflinePlayer and more

dusk flicker
#

it does

shut field
#

that's what I was thinking

#

I just wasn't questioning it

dusk flicker
#

Lol

fluid cypress
#

whats the group manager api equivalent to the /manuaddp command?

worldly ingot
#

Player extends OfflinePlayer. Casting it is literally useless ;p

crude charm
#

^

ivory sleet
#

OfflinePlayer#getPlayer PES_Blush

crude charm
#

wdym

#

what do you plan on using this string for

#

why do you need it as a string

quaint mantle
ivory sleet
#

Idk

#

I haven’t messed with the mojang mappings and spigot together

quaint mantle
#

thats whats making me smash my head against a wall, i cant figure out what they are and how to generate them

quaint sparrow
#

@ivory sleet plz help

ivory sleet
#

?ask

undone axleBOT
#

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.

quaint sparrow
#

I want help in bungeecord

#

It's not working

#

It connects but after next time it doesn't

ivory sleet
hardy swan
#

noob question here, since when ItemMeta#getDisplayName() doesn't return the chatcolor code in front of the name? Anyway to go around this?

ivory sleet
#

It does? I am almost certain

rigid otter
#

Can I know how a world is stored? It stores all block data or other way?

sage swift
#

you can

hardy swan
#

but works now

ivory sleet
shut field
#

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?

sage swift
#

did you run buildtools

#

what dependency are you using

shut field
sage swift
#

le problem

#

run buildtools, switch spigot-api to spigot so you can use nms (base minecraft code)

shut field
#

cause it is not running for me

sage swift
#

how are you "running" it

shut field
sage swift
#

where did you get it

shut field
#

the website

sage swift
#

did you read the instructions on the page from which you downloaded it

quaint mantle
vale cradle
#

Haha good for you mate ;p

vale cradle
#

Got busy

sage swift
#

clearly not

shut field
sage swift
#

read

shut field
sage swift
#

read the fucking instructions and stop pinging me with every message

shut field
#

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?

sage swift
shut field
#

yay it worked

#

thank you

fluid cypress
#

whats better for storing in a database, World.getName() or World.toString()?

dusty herald
#

World#getName

#

if you want the name

#

Locations are ConfigurationSerializable though, keep that in mind

sage swift
#

World#toString will just give the object memory reference, will it not

dusty herald
#

yeah something like that

fluid cypress
unkempt peak
granite burrow
#

Is there anyway to remove this message with code?

unkempt peak
#

hmm i don't think there is an event for sleeping so idk, maybe nms.

#

sorry can't really help with nms

sage swift
#

Bukkit.shutdown(); is guaranteed to remove that message 👍

unkempt peak
#

lmao

granite burrow
sage swift
#

you might be able to respawn the player somehow on death event

granite burrow
sage swift
#

to cancel the respawn process/message?

granite burrow
#

oh that im unsure

unkempt peak
granite burrow
unkempt peak
granite burrow
#

I got it halfway just need to remove message

sage swift
#

what

sage swift
#

that's not at all what he's trying to do, Kidalder

granite burrow
unkempt peak
#

I'm not seeing a way to get or cancel that specific message

#

again might be an nms thing

granite burrow
#

yeah me either, I asked in another discord and they didnt know so I thought might as well ask spigot direct lmao

young knoll
#

Don’t let them actually die using the damage event I guess