#help-development

1 messages Ā· Page 1416 of 1

vast quest
#

Ok kind of a dumb question but how can I get the item that was used I think it is this getActiveItem()

rotund ravine
viscid dune
#

i have to start somewhere

rotund ravine
#

No one here knows skript sry.

#

Or well, no one wants to admit it.

viscid dune
#

ohh

#

then sorry

#

for anoy you

coral sparrow
#

lol

rotund ravine
#

It's fine, you didn't annoy us.

cinder thistle
#

annoyed me

coral sparrow
#

ikr

vast quest
#

anyways how can I get the tool that was used?

#

getActiveItem()?

rotund ravine
#

In what event?

vast quest
#

blockbreak

rotund ravine
#

It'd just be whatever is in the players main hand.

viscid dune
#

maybe ```on break:
if block is (block)
like that

vast quest
#

so it would be?
event.getPlayer().getInventory().getItemInMainHand().containsEnchantment(Enchantment.SILK_TOUCH)

viscid dune
#

ohh java

#

am out

rotund ravine
#

Sure, buut remember to check iteminmainhand is not null or air

vast quest
#

o ye

#

how can it be null?

eternal oxide
#

empty hand can be AIR or null

rotund ravine
#

Not sure, old habit let me check docs

#

Hmm just check if containEnchantment works on air if so you don't have to do any checks.

coral sparrow
#

Hi guys

#

coders

rotund ravine
#

?ask

queen dragonBOT
#

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.

coral sparrow
#

dont ask to ask

#

hehe

#

gotem

queen dragonBOT
#

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.

coral sparrow
vast quest
#

oh no

#

the aids guy

coral sparrow
#

spam

vast quest
#

oh no...

#

welp imma leave before losing braincells! Goodluck guys!

rotund ravine
#

Okay

vast quest
#

Why do I not believe you

#

anway

rotund ravine
#

that one srty

vast quest
#

No one

#

other than you

eternal oxide
#

?services

queen dragonBOT
eternal oxide
#

I gave you the link

vernal basalt
#

how do i use a config in another class

rotund ravine
vast quest
#

o also

#

Condition 'item.getType().equals(Material.AIR)' is always 'false'

#

:D

rotund pond
#

Hey, sorry if I'm disturbing but I don't understand how to do a multi module project using maven for minecraft plugins :/
I do not understand how to say which module to choose depending on the version etc ...
Do you have any link to help me ? (Tuto or whatever)

#

wdym ?

vast quest
#

Aids. No one is going to make a plugin for free to you

rotund ravine
#

@worldly ingot This guy keeps asking for services in dev

eternal oxide
#

I can code it for you. It will only cost you $1000

rotund pond
#

Whut, wrong one

vast quest
#

You guys see why I wanted to leave

worldly ingot
#

?services

queen dragonBOT
vast quest
#

this is his "serious" mode

worldly ingot
#

and if you're continuing to ignore that message I'll happily kick you

#

We have forums for a reason

rotund pond
#

I don't do mods sorry

worldly ingot
#

?resources

queen dragonBOT
rotund pond
#

btw that's cheating

#

So I won't learn to do this

worldly ingot
#

We're not going to encourage unfair advantages in this Discord, it's against Mojang's ToS

#

?kick @quaint mantle

queen dragonBOT
#

šŸ‘¢ Kicked aids#1534

wispy fossil
#

o

rotund pond
#

Your allowed to get help about dev
Nothing more

vast quest
#

Thank you

rotund pond
#

Ah

#

(Nice idea)

vast quest
#

Imma be honest. from the second I saw him here I realised that he would get kicked

rotund ravine
#

Don't continue to talk about him.

vast quest
#

Never

rotund ravine
#

So did we miss someone needing help?

#

Except for the maven guy

rotund pond
#

Well, let's talk about something else

Does anyone knows tutorials to do a multi module project using maven for minecraft plugins :/
I do not understand how to say which module to choose depending on the version etc ...
Do you have any link to help me ? (Tuto or whatever)

#

(Pleaaaase)

rotund ravine
#

It's just a standard multimodule project

rotund pond
#

šŸ¤”

rotund ravine
#

Make a "common" implementation inferface or whatever and multiple submodules that implement them for each version.

vast quest
#

Wait cant I just get the drops on a blockbreak evnet?

rotund pond
vast quest
# rotund ravine yep

So I dont even need to get these silk touch checks cuz minecraft already does that for me

rotund pond
eternal oxide
vast quest
#

mm

#

well uh

#

I guess I can use that

#

since its just for a autopickup

rotund ravine
#

Oh my bad, yeah.

#

Just do .getBlock().getDrops(event.getPlayer().getItemInMainHand())

vast quest
#

shouldnt it just be event.getBlock().getDrops();

#

if I use blockdropevent

eternal oxide
#

drops depend on whats used to break the block

vast quest
#

yes

#

so it would consider fortune and stuff aswell

eternal oxide
#

LUCK, FORTUNE, SILK_TOUCH etc

vast quest
#

yeah so I dont need to check for em myself

rotund ravine
#

Probably not

vast quest
#

how can I remove the dropped items tho

vernal basalt
#

how do i access a config from another class

vast quest
#

setCancelled?

vast quest
rotund ravine
#

nah

eternal oxide
#

yes, and set teh block to air

rotund ravine
#

setDropItems( boolean)

vast quest
#

you jsut need to get an instance

rotund ravine
vernal basalt
eternal oxide
#

I have a feeling setting the drops to false will not be 100% accurate

vast quest
vernal basalt
#

so i can just do plugin.getConfig();

vast quest
#

u need to get a instance

rotund ravine
#

just cancel it then

vast quest
#

if ur not on the main class

vernal basalt
#
    StatApi plugin;

    @EventHandler
    public void armor(PlayerInteractEvent event) {
        for(Player p : Bukkit.getOnlinePlayers()){
            UUID uuid = p.getUniqueId();
            ItemStack helmet = p.getEquipment().getHelmet();
            ItemStack chestplate = p.getEquipment().getChestplate();
            ItemStack leggings = p.getEquipment().getLeggings();
            ItemStack boots = p.getEquipment().getBoots();

            plugin.getConfig().addDefault(uuid + ".helmet", helmet);
            plugin.getConfig().addDefault(uuid + ".chestplate", chestplate);
            plugin.getConfig().saveConfig();
        }
    }```
rotund ravine
#

nully

vast quest
#

wait how can I give the player a collection?

#

it says event.getBlock().getDrops(); is a collection

rotund ravine
#

addItems

#

I suppose

vast quest
#

there is addItem

#

but when I try to add that

#

it says Cannot resolve method 'addItem(java.util.Collection)'

rotund ravine
#

Yeah .toArray(new ItemStack[0])

hidden delta
#
Main plugin = JavaPlugin.getPlugin(Main.class);
vast quest
#

Cannot resolve method 'addItem(java.lang.Object[])'

karmic stirrup
vast quest
#

this is what I have java public void autoPickup(BlockDropItemEvent event) { Collection dropped = event.getBlock().getDrops(); event.setCancelled(true); event.getPlayer().getInventory().addItem(dropped.toArray(new ItemStack[0])); }

rotund ravine
#

Did you do new ItemStack? if so just cast it to itemstack array

#

and ignore the warning with unchecked cast

molten hearth
#

https://paste.ubuntu.com/p/XhMTqtvxCh/ ```java

public class onPlayerJoin implements Listener {

private static HashMap<Location, Boolean> spawnLocations;

public onPlayerJoin() {
    Location seat1 = new Location(Bukkit.getWorld("Dungeons1.1"), 120, 100, -65);
    Location seat2 = new Location(Bukkit.getWorld("Dungeons1.1"), 120, 100, -65);
    Location seat3 = new Location(Bukkit.getWorld("Dungeons1.1"), 120, 100, -65);
    Location seat4 = new Location(Bukkit.getWorld("Dungeons1.1"), 120, 100, -65);


    this.spawnLocations = new HashMap<Location, Boolean>() {{
        put(seat1, false);
        put(seat2, false);
        put(seat3, false);
        put(seat4, false);
    }};

}

@EventHandler
public static void onPlayerJoinEvent(PlayerJoinEvent event) {
    Player player = event.getPlayer();

    player.teleport(getAvailableSpawnLocation(player)); // <----- this is actually line 47 from the traceback
}

private static Location getAvailableSpawnLocation(Player player) {
    System.out.println("Reading entries...");
    for(Map.Entry<Location, Boolean> entry : spawnLocations.entrySet()) {
        if(entry.getValue().equals(false)) {
            entry.setValue(true);
            return entry.getKey();
        } else {
            System.out.println("Not False: " + entry.getValue());
        }
    }
    System.out.println("Finished reading entries...");
    return null;
}

}

#

what kinda sorcery is this

rotund ravine
#

Could also just do dropped.forEach(event.getPlayer().getInventory::addItem)

eternal oxide
rotund ravine
#

or something

karmic stirrup
vast quest
severe folio
#

How and why would BukkitRunnable#getTaskId return null when its return type is Integer? Docs state it returns the task ID, or throws IllegalStateException. Nothing is mentioned about it returning null.

rotund ravine
#

Ahaha idek whyhax just do the other thin

#

g

eternal oxide
vast quest
# rotund ravine Ahaha idek whyhax just do the other thin

ight changed to this seems to not give any errors java public void autoPickup(BlockBreakEvent event) { ItemStack dropped = (ItemStack) event.getBlock().getDrops(); event.setDropItems(false); event.getPlayer().getInventory().addItem(dropped); } }

rotund ravine
#

Ehh nah

vast quest
#

?

rotund ravine
#
public void autoPickup(BlockBreakEvent event) {
        ItemStack[] dropped = (ItemStack[]) event.getBlock().getDrops().toArray(new ItemStack[0]);
        event.setDropItems(false);
        event.getPlayer().getInventory().addItem(dropped);
    }
}
karmic stirrup
eternal oxide
#

createExplosion takes a Location

rotund ravine
#

I think there might be legacy int int int Elgar?

eternal oxide
#

ah, then sorry not helping. Update to 1.16

rotund ravine
#

No like a legacy function

eternal oxide
#

He needs to use teh one that accepts Location then

rotund ravine
karmic stirrup
#

the location in createExplosion needs to get where the egg was thrown

eternal oxide
#

yes, I already said twice. event.getEntity().getLocation() in the ProjectileHitEvent

#

If you want any kills to be attributed to the player who threw the egg, you getShooter() on the projectile and use the createExplosion method that takes a source entity

karmic stirrup
#

Yeah I got it, thanks!

vast quest
#

:/

#

eh ig ill just not add autopickup

rotund ravine
#

That's a bug then

vernal basalt
#

why am i gettting their error

rotund ravine
#

report it to spigot jira

vernal basalt
#

Could not pass event PlayerInteractEvent to Statapi v1.0-SNAPSHOT org.bukkit.event.EventException: null

vast quest
rotund ravine
#

No clue, tag @worldly ingot and hope for the best Block#getDrops(ItemStack) no like fortune

vernal basalt
#

=paste

#

~paste

#

!paste

vast quest
#

@worldly ingot

eternal oxide
#

?paste

queen dragonBOT
vast quest
#

wrong channel

vernal basalt
eternal oxide
#

Api.java:33

vernal basalt
#

plugin.getConfig().addDefault(uuid + ".helmet", helmet);

#

is it not getting the helmet from the player

#

ItemStack helmet = p.getEquipment().getHelmet();

#

oh wait

#

configs can't have itemstacks

eternal oxide
molten hearth
#

its in the link...

rotund ravine
#

at net.neednot.listeners.Api.armor(Api.java:33) ~[?:?]

molten hearth
#

how is that causing a npe? im so confused

vast quest
rotund ravine
#

?jira

queen dragonBOT
vast quest
#

o

#

silktouch doesnt work either

#

:ddddddddddd

rotund ravine
#

lol

wispy fossil
vast quest
#

Block#getDrops(ItemStack) no like enchants

rotund ravine
#

Enchants has always been an issue

#

thought they fixed it tho

vast quest
#

yes this is the fixed version

vernal basalt
#

why would this be causing the npe

#

plugin.getConfig().addDefault(uuid + ".helmet", helmet);

eternal oxide
#

try/catch your constructor code

molten hearth
#

oh alright ty

#

I thought it enabled after the worlds šŸ˜› ty

eternal oxide
#

depends when you defined your class

molten hearth
#

well here java @Override public void onEnable() { /* Import Events */ getServer().getPluginManager().registerEvents(new onPlayerJoin(), this); // logic }

eternal oxide
#

It shoudl be ok, but try/catch to be sure

#

look for any errors at startup

molten hearth
#

alright ty

eternal oxide
molten hearth
#

oh wow alr tx

maiden thicket
#

pls dont use camel case in class names

#

šŸ˜”

vast quest
#

camel?

molten hearth
#

thisTypeOfText

vast quest
#

oh

#

thats just weird

#

Its Like That One Kid Who Types Like This

molten hearth
#

idk I personally like underscores but every tutorial I see uses camelcase

calm quest
#

is it possible to disable the server.properties in the server root folder and just take the one in the spigot.jar

vast quest
#

???

molten hearth
#

perhaps java doesn't support them or maybe people dont like them

eternal oxide
#

camel for methods

vast quest
# rotund ravine Enchants has always been an issue

yeah no it wasnt spigot :/

    public void autoPickup(BlockBreakEvent event) {
        Player player = event.getPlayer();
        ItemStack[] dropped = (ItemStack[]) event.getBlock().getDrops(player.getItemInHand(), player).toArray(new ItemStack[0]);
        event.setDropItems(false);
        event.getPlayer().getInventory().addItem(dropped);
indigo iron
#

how do I check if a player was hit from the back so they take bonus damage

eternal oxide
#

getDamager and check their location in relation to the Player and the players direction

timber crescent
#

This isn't working for some reason

queen dragonBOT
timber crescent
indigo iron
sage swift
#

well you register it twice...?

#

simple error reading

eternal oxide
mortal hare
#

wtf when you give yourself an knowledge_book and rightclick it, it will dissapear. In console it states that it has a null tag

#

is this a bug?

pliant copper
#

How do i cast Bukkit#Block to NMS block?

mortal hare
sage swift
mortal hare
#

so its a bug

vernal basalt
#

what is LocalizedName

mortal hare
#

An item name for the specified language

#

of the player

#

for example if the player select Deutsch

#

it will send itemname

#

you set for that locale

#

because for some reason server gets player's locale info

#

through the packets

#

even though there's no usage for that in vanilla server

#

maybe im wrong

timber crescent
vernal basalt
#

am i doing something wrong here?

#
            if (p.getEquipment().getHelmet().getItemMeta().getDisplayName() != null) {
                String helmet = p.getEquipment().getHelmet().getItemMeta().getDisplayName();
            }
            else {
                String helmet = p.getEquipment().getHelmet().getType().name();
            }```
#

the npe wont go away

eternal oxide
#

many things in there can be null

#

check each

vernal basalt
#

the problem is the NPE is actually

#

String helmet = armor.get(uuid + ".helmet").toString();

#

in the other class

eternal oxide
#

getHelmet() can be null, as can getItemMeta()

vernal basalt
#

so idk what is causing it

eternal oxide
#

the only thing in there that can't be null is the getDisplayName

vernal basalt
#

i only dont get null from it if the helmet has been used in an anvil

#

but now i only get null no matter what

eternal oxide
#

Yes, you are not doing ANY null checks

vast quest
#

Is there anwyay I can set the mobtype of a spawner to null

#

or remove the mob

vernal basalt
eternal oxide
#

the one null check you are doing is on getDisplayName() which can't be null

#

if p.getEquipment().getHelmet() returns null, you can't use getItemMeta()

#

if getItemMeta() returns null you can;t call getDisplayName()

#

even getEquipment() can return null

vernal basalt
#

hmm i haven't checked if they have a helmtet true

eternal oxide
#

you have to check every single place it can be null.

vernal basalt
#

yeah

#

that's my issue

eternal oxide
#
EntityEquipment equipment = p.getEquipment();
if (equipment == null) return;
ItemStack helmet = equipment.getHelmet();
if (helmet == null) return;
if (helmet.hasItemMeta()) {
    // code - helmet.getItemMeta().getDisplayName()
}```
sage swift
#

how can i get nms' EnumHand from EquipmentSlot

#

evt.getHand() == EquipmentSlot.HAND ? EnumHand.MAIN_HAND : EnumHand.OFF_HAND good enough lol

wraith rapids
#

this is the 1337 way of doing it

#
EntityEquipment equipment;
ItemStack helmet;
ItemMeta meta;
String displayName;
if (
        (entityEquipment = p.getEquipment()) != null
     && (helmet = equipment.getHelmet()) != null
     && (meta = helmet.getItemMeta()) != null
     && (
                (displayName = meta.getDisplayName()) != null
             || (displayName = helmet.getI18DisplayName()) != null
         )
) {}
sage swift
#

getI18DisplayName()

wraith rapids
#

papper

sage swift
#

eeeew

#

like toilet paper?

#

spigot like a bidet

viscid oasis
#

Is it possible to remove NPC from tablist that is created with NMS packets?

wraith rapids
#

yes

#

as for how, dunno, maybe look into how other plugins do it

viscid oasis
#

tried this:
connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, npc));
but it load them without skin and when i join to server and they are not nearby, the will not spawn at all

dense goblet
#

summary: make it impossible to smelt a certain item

quaint mantle
#

Is console included in Server#broadcast(String message, String permission)?

sullen marlin
#

Yes

blazing scarab
viscid oasis
viscid oasis
wraith rapids
#

there's like a prepare smelt event or something iirc

eternal night
#

FurnaceSmeltEvent

#

yea

#

just check the ingredients and cancel respectively

viscid oasis
#

but that will clog the furnace

#

but it is a way too

wraith rapids
#

i'm not sure what vanilla does with unsmeltable items

#

if it lets you clog the furnace with them, then whatever you're doing should probably too

#

and vice versa

quaint mantle
dense goblet
dense goblet
#

in a similar vein, is there an event for smithing? If not I guess I can use the same logic as with the furnace

wraith rapids
#

the anvil mechanics in the game are pretty fucked and the protocol around that area is trash

#

it's possible to get stuff working with the pre anvil and anvil events but it's never fun

dense goblet
#

nah not even the anvil, but thats a good point too, I meant the 1.16 smithing table

wraith rapids
#

also fucked iirc

dense goblet
#

really weird how they introduced a new block just for netherite

wraith rapids
#

basically all of the interactable inventories added after furnace are fucked

dense goblet
#

is that an API thing or a mojang thing

wraith rapids
#

both

#

the protocol is super cancer around those parts, with how the server and client communicate about stuff

#

with the client doing whatever it wants and ignoring the server and vice versa

#

it's a shit show cobbled together from shit that somewhat functions in vanilla, but trying to write an api that doesn't shit bricks when you try to do something with it is hard

dense goblet
#

a lot of these issues could be circumvented if spigot supported adding new blocks and items like i.e. fabric/forge, and just sent a vanilla ID to the client

wraith rapids
#

mojang support for that is pretty lackluster currently as well

dense goblet
#

mojang support for extending the game has always been pretty crap

wraith rapids
#

you can modify the textures of existing items and their subtypes, and you can like add and modify loot tables and world generation stuff and some other mechanics like climbable blocks through tags

dense goblet
#

they dont really acknowledge that modding keeps the game alive and try to keep it unofficial for some reason

#

ah yeah they are pushing data packs

wraith rapids
#

and I suppose there's recipes in datapacks now too but they are kinda trash right now and won't help you with anvils and whatnot

dense goblet
#

but those aren't a replacement for plugins and mods

wraith rapids
#

it's still a long way from being fully data driven

dense goblet
#

using datapacks also seems like a very easy way to make the game less efficient than it already is

wraith rapids
#

and since splƶgget needs to work with vanilla clients, it can't exactly send whatever it wants to the client

dense goblet
#

yeah but as long as it sends valid packets then it should be ok, right?

#

i.e. if I added a steel ingot that is treated as its own item server-side but represented as a netherite ingot when sent to the client, it shouldn't mess up too much

wraith rapids
#

yeah, but mojang's support for data driven stuff is still in its infancy even on the client

dense goblet
#

true

wraith rapids
#

and it's not like bukkit is having a good time with the data driven shit either

#

we haven't even gotten rid of the material or biome enums yet

#

there's some pr for it supposedly but it's probably not going to be merged in the next decade

glass sparrow
#

1.18 is the update for the servers guys just you wait

dense goblet
#

oh yeah enums wont work for runtime generated shit

#

vanilla seems to be getting its own sort of oredict which sounds decent

#

or it already has idk

wraith rapids
#

pretty much everything is already registries and data driven internally

#

just the api can't reflect it because muh fucking 1.8 plugins backwards compat will break

dense kestrel
#

1.8 plugins are the best sunglasses

dense goblet
#

fun fact 1.8 is closer to Minecraft's first 2009 release than it is to now

dense kestrel
#

ik, so its what the ogs play!

dense goblet
#

I've been mentally stuck on 1.12 since 1.7.10 died so seeing anything that came after it always feels fresh

dense kestrel
#

XD

#

nah, i just like how well 1.8.8 servers run

dense goblet
#

honestly ever since 1.3 mc runs like shit lol

#

reject modernity return to 1.2.5

wet breach
#

can't expect features to not take up resources

dense kestrel
#

1.12 ran fine, but 1.8.8 has the best jars

wraith rapids
#

i remember back in the day when my shitty laptop could run a singleplayer world with like 100 loaded villagers

dense kestrel
wraith rapids
#

now modern server grade machines will fucking catch fire and die with 100 loaded villagers

dense goblet
#

its not really the features that take up resources, they have some questionable coding practices from what I've heard

wraith rapids
#

they throw streams around a lot

dense goblet
#

don't streams make use of multithreading so it should make the server run better?

wraith rapids
#

paper has squeezed quite a bit of more performance out of the serbur by just replacing streams with not streams

#

streams are just for loops with syntactic sugar and more overhead

dense goblet
#

apparently paper is not as thread-safe as spigot

wraith rapids
#

that is a strange statement

dense kestrel
#

I think Bestle made a pretty good 1.16 jar though

#

so its possible to make a server run fast on it

wraith rapids
#

just strip everything out and it'll run fast

#

but expecting vanilla functionality is out of the question

dense goblet
dense kestrel
#

held 500 players no issues

wraith rapids
#

yeah in like a lobby somewhere

dense kestrel
#

no

wraith rapids
#

throw some villagers at it

#

it'll die

dense kestrel
#

Factions

#

Vanity

wet breach
#

paper is bleeding edge of things. Sometimes it works well, other times it has some bugs lol

#

Spigot is the stable line of things

wraith rapids
#

i'd argue the bleeding edge is a bit further downstream these days

#

of course the bleediest edge is yatopia

wet breach
#

they should strive to update it after they created it though

wraith rapids
#

i don't blame the developers

#

they've got the suits pushing them to create more content and revenue as fast as possible

wet breach
#

yeah, most of the time it isn't the developers choice in what they get to work on

#

fortunately that is changing though šŸ™‚

wraith rapids
#

i'll believe it when i see it

wet breach
#

with more indie developer games and what not game studios are not obtaining the talent they need

#

eventually they will be forced to change their ways

wraith rapids
#

one can hope, I suppose

#

imo we should just go back to being hunter gatherers

wet breach
#

crunch time is something that needs to die in a fire -.-

wraith rapids
#

that worked pretty well

wet breach
#

completely unnecessary most of the time

dense goblet
#
@EventHandler(ignoreCancelled = true)
    public void onInventoryClick(InventoryClickEvent e) {
        if(e.getClickedInventory() instanceof FurnaceInventory) {
            if(CustomItem.getFromStack(e.getCursor()) != null) {
                e.setCancelled(true);
            }
        }
    }
#

I think it happens if I both left- and right-click simultaneously

wraith rapids
#

are you sure you don't just want to cancel the smelt events

dense goblet
#

yeah those only occur after the fuel is used and the item is fully smelted, from what the docs say

dense goblet
wraith rapids
#

did you try the prepare smelt event

stone sinew
#

player

dense goblet
#

ah player

wraith rapids
#

or whatever it's called

#

i vaguely remember there being an event that's fired before the smelting starts

dense goblet
#

that is for fuels IIRC

#

I don't see an updateInventory function, best I can do is e.getWhoClicked().getInventory()

wraith rapids
#

could just remove the furnace recipe from the recipe map šŸ‘€

dense goblet
#

yeah but that would do it for vanilla items too :/

#

ahh ty

#

hmm I can still spam it, and I don't even narrow it down by event so it should be more strict

wraith rapids
#

the method returns a HumanEntity which doesn't have a player inventory to update

#

which is like some strange sort of npc support from mojang's side

dense goblet
#
@EventHandler(ignoreCancelled = true)
    public void onInventoryClick(InventoryClickEvent e) {
        if(e.getClickedInventory() instanceof FurnaceInventory) {
            if(CustomItem.getFromStack(e.getCursor()) != null) {
                e.setCancelled(true);
                Player p = (Player) e.getWhoClicked();
                p.updateInventory();
            }
        }
    }
wraith rapids
#

you'll find yourself casting humanentity to player when working with inventories

dense goblet
#

same result as without the last 2 lines

#

thats good to know tho

wraith rapids
#

you need to listen to drag event as well

#

dragging even 1 pixel with lmb down will fire a drag event rather than the click event

#

even if you're only placing items in one slot

#

i'm guessing you spamming your lmb is causing your mouse to sometimes move a pixel or two with the button down, which then goes past your listener

dense goblet
#

thought updating the player's inventory would change it due to some quirk

#

I think NNY is right

wraith rapids
#

i'm a pretty right guy

dense goblet
#

added the drag event and it still doesnt seem to work :/ just got 32 of one into the furnace

wraith rapids
#

well it's definitely a thing that happens

dense goblet
#

weird that it happens at all, you'd think it would be a client side thing at worst

#
@EventHandler(ignoreCancelled = true)
    public void onInventoryClick(InventoryClickEvent e) {
        if(e.getClickedInventory() instanceof FurnaceInventory) {
            if(CustomItem.getFromStack(e.getCursor()) != null) {
                e.setCancelled(true);
            }
        }
    }

    @EventHandler
    public void onInventoryDrag(InventoryDragEvent e) {
        if(e.getInventory() instanceof FurnaceInventory) {
            if(CustomItem.getFromStack(e.getCursor()) != null) {
                e.setCancelled(true);
            }
        }
    }

    @EventHandler(ignoreCancelled = true)
    public void onInventoryMove(InventoryMoveItemEvent e) {
        if(e.getDestination() instanceof FurnaceInventory) {
            if(CustomItem.getFromStack(e.getItem()) != null) {
                e.setCancelled(true);
            }
        }
    }
#

forgot to ignore cancelled but shouldnt change anything

#

I need to stop an item from being smeltable if it has certain NBT (i.e. it is a custom item)

sage swift
#

if a PlayerShearEntityEvent event triggers, can i expect EntityDropItemEvent to trigger right after without anything else happening in-between?

wraith rapids
#

uh, let me check

dense goblet
#

interesting, ill try that

final fog
#

Does anyone know how I can get the server TPS?

wraith rapids
#

the sound is fired first

sage swift
#

Bukkit.shutdown()

wraith rapids
#

but other than that there shouldn't be anything happening in between

eternal oxide
#

Not in Spigot

sage swift
#

since it's single threaded it should work fine though i think

final fog
#

Couldn

#

acciidentally pressed enter smh and I couldn't find it

#

what would I calculate?

sullen marlin
#

TPS is a stupid metric

wraith rapids
#

use mspt

#

which, is it even exposed by splƶgget

sullen marlin
#

mspt is just inverse tps...

wraith rapids
#

false

#

tps caps at 20

#

mspt does not

sage swift
#

Math.min(20, tps)

sullen marlin
#

point being its completely unclear as to what 'tps' even is

sage swift
#

TPS: 100 (20)

wraith rapids
#

what

#

how is that unclear

#

its definition is literally in its name

sullen marlin
#

ticks in the last second? rate of the last tick? rolling average? weighted average? simple average?

dense goblet
#

uhh not fully

wraith rapids
#

depends on how you calculate it

#

how do you calculate mph?

dense goblet
#

it has the side-effect of cancelling your action if you want to put the item back into your own inv, and also the drag problem persists

wraith rapids
#

saying tps is useless because it can't be defined in an instantaneous context is like saying that the rpm or speed gauge of your vehicle is useless because of the same reason

sullen marlin
#

mph is the derivative of a smooth continuous function

#

its absolutely not comparable to tps

crude charm
#

lots of custom spigots add graphs to /tps

wraith rapids
#

units of action per units of time

#

they are the same, the only difference is that ticks go through discrete increments

main dew
#

How get texture skull with ItemStack?

sullen marlin
#

of a smooth continuous function

crude charm
main dew
dense goblet
#

1/Max(mspt, 0.05) is the best approx you'll get for TPS at a single point

sullen marlin
wraith rapids
#

and what even is the problem

crude charm
#

why are my messages getting deleted...

wraith rapids
#

because the bot is trash

crude charm
sullen marlin
#

'TPS' is a meaningless measure and you need to figure out what exactly you want and for what purpose

main dew
#

SkullMeta.get what? xD

crude charm
#

setOwner

main dew
#

GET texture

crude charm
#

?

wraith rapids
#

i disagree with your assessment

crude charm
#

SkullMeta

wraith rapids
#

get the property representing the texture

eternal oxide
#

TPS is a general indicator of server load, but thats all.

crude charm
#

^

#

you can use spark and timings to get a better idea

wraith rapids
#

mspt is the single most prominent indicator of how much time you have versus how much time you need on the main thread

main dew
crude charm
sullen marlin
#

mspt of what?

#

the last tick?

#

the last 5 ticks?

#

the average of the last 5 ticks?

wraith rapids
#

depends on what you want

dense goblet
#

do you want stability or precision?

crude charm
wraith rapids
#

you can get the current nanoseconds spent in the current tick if that's what you want

crude charm
#

50 100 1000

sullen marlin
#

'TPS' is a meaningless measure and you need to figure out what exactly you want and for what purpose

crude charm
#

idk

main dew
#

I want get texture with skull (ItemStack) texture no owner

dense goblet
#

this is the same reason as for the Heisenberg principle

wraith rapids
#

and mspt is a very good general indicator for the vast majority of such purposes

crude charm
#

then use #setOwner

dense goblet
#

and also same reason why FFTs (e.g. when displaying frequencies present in some music at a certain "point" in time) need a defined RMS

#

if you've ever seen a music visualiser with bars, those are the frequencies over some period of time (say 50ms)

main dew
dense goblet
#

is discord dying or is it my internet

sage swift
#

dicord

deft widget
#

Hey guys do you know how to add potion effects while holding an item? i created everything but effects are applying when i change slot and idk what to do

dense goblet
#

maybe keep a bool in memory for each player and set it to true when the player holds the item and to false when he holds something else?

#

thats the best solution I can think of

sage swift
deft widget
#

i will try thx

dense goblet
#

or alternatively, apply the effect for 2s and check as it is about to expire

crude charm
#

But that still doesn’t make sense

#

How do you want to get it

#

The name

#

Save it

#

How

dense goblet
#

what is your code for the held item event?

deft widget
# dense goblet what is your code for the held item event?

public class onInteract implements Listener {
private ItemStackEme aura = new ItemStackEme();
@EventHandler
public void onHeld(PlayerItemHeldEvent e) {
Player p = e.getPlayer();
ItemStack i = e.getPlayer().getItemInHand();

    if (e.getPlayer().getInventory().getItemInHand().isSimilar(aura.getEmerald())) {
        p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 100000, 2));
        p.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 100000, 2));
        p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 100000, 2));
    } else {
        p.removePotionEffect(PotionEffectType.SPEED);
        p.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
        p.removePotionEffect(PotionEffectType.REGENERATION);
    }
#

its something like this

sage swift
#

```java
code here
```

deft widget
#

oh thx

sage swift
#

?paste or that

queen dragonBOT
sage swift
#

could it be that the event isnt firing when you hold nothing?

#

potion effects should really be by plugin

deft widget
#
ublic class onInteract implements Listener {

    private ItemStackEme aura = new ItemStackEme();
    @EventHandler
    public void onHeld(PlayerItemHeldEvent e) {
        Player p = e.getPlayer();
        ItemStack i = e.getPlayer().getItemInHand();

        if (e.getPlayer().getInventory().getItemInHand().isSimilar(aura.getEmerald())) {
            p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 100000, 2));
            p.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 100000, 2));
            p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 100000, 2));


        } else {
            p.removePotionEffect(PotionEffectType.SPEED);
            p.removePotionEffect(PotionEffectType.FIRE_RESISTANCE);
            p.removePotionEffect(PotionEffectType.REGENERATION);
        }
deft widget
sage swift
#

like chunk tickets

#

so you can keep a chunk loaded from multiple plugin if necessary but if one plugin removes its ticket the other one will keep the chunk loaded

#

so that if you drink a speed potion you get minecraft:speed but if your plugin gives an effect it gives plugin:speed and then it can remove it without affecting the original time

wraith rapids
#

potion effects are fucked

deft widget
wraith rapids
#

a ticket or namespace based system like that would be great

#

i doubt anybody is ever going to get around to making it happen though

#

we sort of have that with attributes and attribute modifiers

deft widget
#

and i dont know how to do it XD

#

im really noob at this

dense goblet
deft widget
#

sorry for stupid questions but where i have to paste it?

dense goblet
#

sorry that was just my code for a different thing

hidden delta
#

?paste

queen dragonBOT
sage swift
#

paste!

main dew
#

How read Value with NBTTagCompound
{SkullOwner:{Id:"868344cc-6b00-11eb-9439-0242ac130002",Properties:{textures:[{Value:"WHAT I WANT READ"}]}}} I try this tag.getCompound("SkullOwner").getCompound("Properties").get("textures");

wraith rapids
#

just get the texture property through the api

main dew
#

how?

wraith rapids
#

not sure how you do it with spigot, but it ought to be possible

#

get the skullmeta and get the skull owner and then get its "textures" property

dense goblet
#

spigot doesnt support NBT very well from my experience

#

only abstractly

main dew
#

SkullMeta haven't texture

dense goblet
#

what type do you want the texture as?

sage swift
#
    public static ItemStack createHead(String url, String name) {
        ItemStack head = new ItemStack(Material.PLAYER_HEAD);
        if (url.isEmpty()) {
            return head;
        }
        
        SkullMeta headMeta = (SkullMeta) head.getItemMeta();
        GameProfile profile = new GameProfile(UUID.randomUUID(), null);
        profile.getProperties().put("textures", new Property("textures", url));
        
        try {
            Field profileField = headMeta.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            profileField.set(headMeta, profile);
        }
        catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException ex) {
            ex.printStackTrace();
        }
        
        headMeta.setDisplayName(ChatColor.RED.toString() + ChatColor.BOLD + name + " Head");
        head.setItemMeta(headMeta);
        
        return head;
    }```
main dew
#

no create

hidden delta
#

he need to read the texture

main dew
#

get texture with skull

hidden delta
#

and modify it

main dew
hidden delta
#

just getting?

main dew
#

yea

sage swift
#

hdb api lol

hidden delta
#

1minute

main dew
hidden delta
#

@main dew which version you are using?

main dew
#

1.12.2

quaint mantle
#

Hello, anyone? šŸ™‚

tame jolt
#

I have a question. Im trying to reload my config from another class, and im getting a error with this line:
EasySpawn.getInstance().reloadConfig();
Here is my main class:

public final class EasySpawn extends JavaPlugin {
    private static EasySpawn instance;
    FileConfiguration config = getConfig();
    @Override
    public void onEnable() {
        instance = this;
        saveDefaultConfig();

        getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "EasySpawn has successfully loaded!");
        getServer().getPluginManager().registerEvents(new Events(this), this);
        this.getCommand("esreload").setExecutor(new ReloadCommand());
    }
    public static EasySpawn getInstance(){
        return instance;
    }
}```
Here is my reload command class:
```js
public class ReloadCommand implements CommandExecutor {
    EasySpawn plugin;
    public ReloadCommand(EasySpawn instance) {
        plugin = instance;
    }
    public ReloadCommand() {
    }
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.getName().equals("creload")) {
            if (sender.hasPermission("chatmessage.reload")) {
                EasySpawn.getInstance().reloadConfig();
            } else {
                sender.sendMessage(ChatColor.RED + "You dont have permission to use this command!");
            }
        }
        return true;
    }
}```
#

I'm super confused on how to fix this? Ive been looking at this for too long šŸ˜‰

hidden delta
#

@main dew I will be back for you I will just get shower

main dew
#

oke ty

hidden delta
#

just txt me in dm

main dew
#

@hidden delta

((NBTTagList) tag.getCompound("SkullOwner").getCompound("Properties").get("textures")).get(0).getString("Value");```work šŸ˜„
main dew
#

but how I search this in google I find this

#

and in this I find this java tag.getCompound("SkullOwner").getCompound("Properties").getList("textures",10).get(0).getString("Value");

vernal basalt
#

why doesn't my config save

#
            plugin.getConfig().addDefault(uuid + ".chestplate", chestplate);
            plugin.saveConfig();```
sullen marlin
#

.options().copyDefaults(true)

eternal oxide
#

or just add and no default

hidden delta
#

@sullen marlin you are faster than me

eternal oxide
#

or I'm thinking of set

vernal basalt
paper viper
#

what lmfao

vernal basalt
#

nvm

quaint mantle
#

Hello, does anybody have an idea about this? šŸ˜„

quaint mantle
#

In this video, I went over how to remove and replace pathfinder goals for custom 1.15 spigot mobs :) Next video is over custom pathfinder goals!

Download XAMPP: https://www.apachefriends.org/download.html
SQL Info: https://www.w3schools.com/sql/sql_syntax.asp

Want more videos?
Become a Patreon support to gain access to more videos!

Pa...

ā–¶ Play video
#

And another mob is working

#

only Vindicator not working

deft sedge
#

?paste

queen dragonBOT
crude charm
crude charm
quaint mantle
#

I already checked with bukkit.broadcastmessage šŸ™‚

#

and what method are you saying?

crude charm
#

goalSelector

quaint mantle
#

hmm. how to define goal selector inside the method?

#

i don't understand 😦

crude charm
#

put the field inside the method

#

also as I previously said you select the path

#

but never run it

#

or set it to an npc to run

glossy scroll
#

Isnt that pathfinder supposed to be a target selector?

#

Not a goal selector?

quaint mantle
#

I have a test variable, and I am taking a string message from config containing %test% as a placeholder. Now I want to replace that %test% to variable test. How do I do that?

young knoll
#

String.replace

quartz anchor
#

how do I use custom font for item name and lore tho

young knoll
#

Probably NMS

quartz anchor
#

1.16 have a new featured called custom font

#

kek i'll use nms then

young knoll
#

I don’t think we have support for components on items yet

#

But I could be wrong

#

I found out you don’t seem to be able to damage an entity with a specific cause without NMS

#

Which is unfortunate

quaint mantle
#

small question : what is PathfinderGoalFloat ?

ivory sleet
#

I presume it has to do with flying entities / floating entities

quaint mantle
#

ty

#

small question 2: Is there a pathfindergoal that allows entities to move to players?

ivory sleet
#

Yes

#

ParhFinderGoalTarget or smtng

quaint mantle
#

can you tell me? I couldn't find 😦

#

ty

ivory sleet
#

Long time since I worked with it

quaint mantle
#

thanks you. can you gimme example?

#

i dont know args

#

this.goalSelector.a(0, new PathfinderGoalTarget(hmm?));

ivory sleet
#

Nono

#

this.targetSelector

quaint mantle
#

ah

ivory sleet
#

then you have a goal on the goal selector which is something like PathfinderGoalMoveToTarget

quaint mantle
#

btw, should I use it like this

            @Override
            public boolean a() {
                return false;
            }
        });```
#

ah

#

ty

ivory sleet
#

No probably not

#

Google the goal

#

It should give something relevant

quaint mantle
#

and I was tried hard to find the goals

#

but i couldn't find

#

There is

#

PathfinderGoalMoveTowardsRestriction() and PathfinderGoalMoveThroughVillage() and PathfinderGoalMoveTowardsTarget() only. in "Move" keyward

quaint mantle
#

and PathfinderGoalMoveTowardsTarget() doesn't go to target. it goes to nearly target

#

I feel like he avoiding target.

quaint mantle
#

Also, pillager doens't attack if he held diamond

#

how can I make him to attack player

high turret
#

Hey everybody, how do I create a hover tooltip for a chat message in Spigot 1.16.5?

#

Answers I found online state that I have to create a TextComponent and then use setHoverEvent() on that, but I couldn't find anything about either on the spigot javadocs

#

Has it been removed? If yes, what's the best way to do it as of now?

maiden thicket
#

it's built into spigot's api i believ

high turret
#

oh, thanks

#

appreciate it

quaint mantle
#
String MSG = plugin.getConfig().getString("FinalKillMessage");
MSG.replace("%victim%", vicname);
MSG.replace("%killer%", name);
a.broadcast(ChatColor.translateAlternateColorCodes('&', MSG));
#

why this is not working

#

both vicname and name are defined as Player.getName()

summer scroll
#
String MSG = plugin.getConfig().getString("FinalKillMessage").replace(...);
sullen marlin
#

strings are immutable

#

MSG = MSG.replace("%victim%", vicname);

#

also avoid all caps for local variables names

quaint mantle
#

thanks

quaint mantle
#
Team k = a.GetPlayerTeam(p);
String kcolor = k.getColor().toString();

This gives Color:[rgb0x00FF] as kcolor
So I need to make a placeholder for color and when used in config it should work as a color code. I am confused how will I do.

clear iris
#

Possible to give distance attribute to CustomName?

quaint mantle
#
package de.lennard.development.gui;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scoreboard.*;

public class Scoreboard {

    @EventHandler
    public void join(PlayerJoinEvent event){
        Player player = event.getPlayer();

        ScoreboardManager m = Bukkit.getScoreboardManager();
        Scoreboard b = (Scoreboard) m.getNewScoreboard();

        Objective o = ((org.bukkit.scoreboard.Scoreboard) b).registerNewObjective("Gold", "");
        o.setDisplaySlot(DisplaySlot.SIDEBAR);
        o.setDisplayName(ChatColor.DARK_AQUA + "Lennard's Community");

        Score gold = o.getScore(ChatColor.WHITE + "Skill: " + ChatColor.GOLD + "10");
        gold.setScore(1);

        player.setScoreboard(b);


    }

}
#

This gets me a error:

#

incompatible types: de.lennard.development.gui.Scoreboard cannot be converted to org.bukkit.scoreboard.Scoreboard

#

Why?

sullen marlin
#

wrong import

#

or you're mixing types in your plugin

#

suggest renaming class de.lennard.development.gui.Scoreboard

chrome beacon
quaint mantle
#

How can i fix it

#

@chrome beacon

chrome beacon
#

._.

quaint mantle
#

Oh i need to rename

#

or wdym

near crypt
#

hi @sullen marlin

#

I love u šŸ˜„

#

#no homo

near crypt
#

how can i set the damage that a player gets to 0 ?

#

is it player.setNoDamageticks?

vast quest
#

how can I simulate the particles when a coblbestone gets generated

spring river
#

you can also cancel the event

near crypt
#

but i just want something with player.

spring river
#

You need to use EntityDamageEvent i think

near crypt
#

not this?

spring river
#

maybe, idk šŸ˜…

cold field
#

Hum, hi guys. Does anyone have any idea why when I send a playerinfopacket with inside an entity with a skin to a target player if the target is still joining it spawns the npc without rendering the skin?

harsh matrix
#

Hi, i got a problem with my plugin. I get a NullPointerException(i think)
Log: https://pastebin.com/NphKtiLj
Code: https://github.com/PixelAgent007/ezmana

btw. the 3 functions in ManaController.java have to be static, i cant change that

GitHub

Contribute to PixelAgent007/ezmana development by creating an account on GitHub.

chrome beacon
near crypt
#

?paste

queen dragonBOT
near crypt
cold field
#

😦

harsh matrix
ivory sleet
#

Give me the engine ok thx

chrome beacon
languid geode
#

@static bay Very nice is this publicly available or going to be?

#

@near crypt Please refrain from pinging MD

static bay
#

@languid geode Sadly won't until we can provide some sort of partnership with MM or Blockbench. We'll need to polish this in order to do so.

languid geode
#

Fair make them šŸ’° first šŸ™‚

vast quest
#

how can I do something every X seconds

#

from the start

quaint mantle
#

Timer

vast quest
#

how?

#

how can I use that

lofty mulch
#

You may want to use RepeatTask

snow latch
#

How can I change a users Skin only while they are on my server?

vast quest
#

how

lofty mulch
vast quest
#

so this would do it every second right since its 20L which means 20 ticks?

        BukkitScheduler scheduler = getServer().getScheduler();
        scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
            @Override
            public void run() {
                // Do something
            }
        }, 0L, 20L);```
lofty mulch
#

I think so

snow latch
#

True

#

And if you want it not to do it directly, just change the 0L to 20L too

vast quest
#

2L will be 2 ticks

#

right

#

after start

snow latch
#
  • 20 šŸ˜…
vast quest
#

o

snow latch
vast quest
#

ok

snow latch
#

I did it slightly different in my plugin

vast quest
#

?

snow latch
vast quest
#

so it would be 15 seconds?

snow latch
#

Yep

#

Each 15 seconds it reloads the scoreboard

#

So that the users money is always recent

vast quest
#

oh

#

I need to make a item spawner plugin

#

:d

snow latch
#

For bedwars?

vast quest
#

Nah for a skyblocc server

snow latch
#

Ah I see

vast quest
#

I have come to the realisation that the quality standards are so low in my country

snow latch
#

What country?

vast quest
#

turkey

snow latch
#

I'm from germany

vast quest
#

hwo can I write to a default config

snow latch
#

Default config wdym?

vast quest
#

like uh

#

not custom yml

snow latch
#

Then to what? Xd

#

The server properties?

vast quest
#

im trying to register the blocks location

#

to the config so I can spawn a item there

snow latch
#

Then why not just create a yml for that?

vast quest
#

idk

#

how can I write there tho

snow latch
#

Idk i don't use ymls

#

I send data to my website and do everything by api calls

vast quest
#

ah

snow latch
#

But it shouldn't be difficult

vast quest
#

welp

#

Google it is!

snow latch
#

Xd

lofty mulch
snow latch
#

I love Google

#

I love Google so much

vast quest
#

huh

#

lets hope this works

#

getConfig().set("demir."+ event.getPlayer() +"", event.getBlockPlaced().getLocation());

quaint mantle
#

if you're storing it long term I'd advise using their uuid

lofty mulch
#

event.getBlockPlaced().getLocation() btw this will return serialized object string

quaint mantle
#

he's also using even.getPlayer()

lofty mulch
#

ah

young knoll
#

Location is serializable

quaint mantle
#

just gonna get craftbukkit{hhdhehendn}

young knoll
#

Player is not, use their uuid

wispy monolith
#

is GameProfile no longer available?

wraith rapids
#

i don't remember if it ever was on spigot

wispy monolith
wraith rapids
#

need either the nms or paper's playerprofile api

wispy monolith
wraith rapids
#

not really

wispy monolith
#

bcz I guess it was in spigot

wraith rapids
#

my guess is based on how skullmeta doesn't seem to have any methods to get the owning profile

#

i haven't really looked

languid geode
#

What you need?

wispy monolith
#

GameProfile

weary fossil
#

hi

languid geode
#

Have you tried i dont the the documentation

weary fossil
#

i have an problem

#

i tried to make a "suptop" on my ticket plugin

languid geode
#

A what now

#

?paste

queen dragonBOT
languid geode
#

please

weary fossil
#

sorry

languid geode
#

Any errors and whats the expected behavior

weary fossil
#

NullPointerExeption

#

on line 41

languid geode
#

where

weary fossil
#

for (Entry<String, Integer> entry : valores)

wraith rapids
#

valores is probably null

weary fossil
#

valores is a list

wispy monolith
wraith rapids
#

that doesn't mean it can't be null

#

a List can be null

weary fossil
#

sure

wraith rapids
#

yeah that's not spigot

#

that's mojang's authlib

#

which you can import separately

weary fossil
#

what i do?

wraith rapids
#

you make it not null

weary fossil
#

after

languid geode
#

You wait until i get see wtf this code is i need to go grab some eye bleach

weary fossil
#

valores = streamOrdem.collect(Collectors.toList());

languid geode
#

streamOrdem is empty then

weary fossil
#

on the streamorder

wispy monolith
weary fossil
#

sure

wraith rapids
#

yeah you haven't imported it as a dependency in your IDE

#

it's not part of spigot-api

languid geode
#

Why are you using so mean stream operations this hurts

wraith rapids
#

you'll have to import the mojang authlib in your dependency manager or whatever you use

languid geode
#

@wispy monolith You need to import the build spigot jar

#

not the maven variant it only contains bukkit

wispy monolith
#

How can I import that in maven

wraith rapids
#

or alternatively build spigot locally and build against spigot instead of spigot-api

wispy monolith
#

without manual import

wraith rapids
#

you'll need to find the maven/whatever artifact information for it

#

and then enter it into your dependency manager

#

alternatively, build spigot locally and build against spigot instead of spigot-api

wispy monolith
#

Do u know where can I find it? or what should I google?

wraith rapids
#

dunno

#

searched for "mojang authlib dependency artifact information"

#

second search result

#

first search result is a forum thread on spigot where a bunch of seething tards tell the guy to import spigot jar as an artifact and nobody gets anything useful done

#

those can be generally ignored

young knoll
#

Yeah I just use NMS for it

#

Since that has it

craggy cosmosBOT
wispy monolith
#

What is the latest version of craftbukkit?

#

same as spigot?

wraith rapids
#

why

languid geode
#

spigot = craftbukkit

wraith rapids
#

what are you trying to do with craftbukkit

weary fossil
#

what is the best way to make "List<Entry<String, Integer>>" not be null?

#

i'm learning java recently

wispy monolith
wraith rapids
#

assigning a value to the variable

#

a variable without a value is null

weary fossil
#

entry.setValue?

#

or no?

wispy monolith
#

I want to make this command

#

which needs CraftBukkit

wraith rapids
#

no

#

that needs NMS

#

which is bundled in with spigot

weary fossil
#

NMS?

wraith rapids
#

@ hesham

weary fossil
#

ah, sure

wispy monolith
#

the import must be like this

weary fossil
#

nms = net.minecraft.server

wraith rapids
#

yes

#

that is included in NMS

#

which is included in spigot

#

the namespace belongs to craftbukkit because craftbukkit is the one who originally declared the class

wispy monolith
#

But the CraftPlayer isn't there

weary fossil
wraith rapids
#

yes, because you're depending on spigot-api

#

not spigot

languid geode
#

Didnt i explain this a few posts back you need to import the spigot jar not the spigot-api maven

wraith rapids
#

build spigot locally and build against spigot instead of spigot-api

#

the dependency information is the same except for the name, which is spigot instead of spigot-api

wispy monolith
wraith rapids
#

yes, import it via maven

languid geode
#

system scope?!

weary fossil
languid geode
#

i know its bad

wispy monolith
#

I want to import other stuff and it always tries to import it for the spigot repo even I insert the repo of the thing I want to import

wraith rapids
#

show your pom

wispy monolith
#

repo I need

<repository>
            <id>minecraft-repo</id>
            <url>https://libraries.minecraft.net/</url>
        </repository>
lofty mulch
#

wot

daring sierra
#

why not show your pom??

#

thats just dumb?

lofty mulch
#

show dependencies config

#

not repo

wispy monolith
#
<dependency>
            <groupId>com.mojang</groupId>
            <artifactId>minecraft-server</artifactId>
            <version>1.4.4</version>
            <scope>provided</scope>
        </dependency>
lofty mulch
#

are u dumb?

wispy monolith
#

it's not imported in spigot

wraith rapids
#

import spigot

languid geode
#

šŸ¤¦ā€ā™‚ļø

wraith rapids
#

it's included in spigot

languid geode
#

Im not even

wispy monolith
#

But I already used maven

lofty mulch
#

import SPIGOT

#

not MINECRAFT-SERVER

wispy monolith
# lofty mulch not MINECRAFT-SERVER

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

#

already there

lofty mulch
#

SPIGOT

wraith rapids
#

import SPIGOT

#

not SPIGOT-API

#

fifth time i'm saying this

lofty mulch
#

smh

languid geode
#

HAHA im laughing my ass off he just wont listen

wraith rapids
#

<artifactId>spigot-api</artifactId>
change to
<artifactId>spigot</artifactId>

lofty mulch
#

imagine Mojang publish minecraft-server to public maven-repo

languid geode
#

Lolz never happening i had to fight tooth and nail to get access to their github

lofty mulch
#

whose github?

languid geode
#

mojang's

lofty mulch
#

lol

#

I dont think they will push Minecraft souce code to github

languid geode
#

They do actually

lofty mulch
#

lol

languid geode
#

but only a few select people have access to it mostly community developers

clear iris
#

bro why pumpkin deprecated

languid geode
#

:what:

wraith rapids
#

you're deprecated

earnest junco
#

literally tells u

languid geode
#

I know ;-;

wraith rapids
#

imagine reading

languid geode
#

RTFM

earnest junco
clear iris
#

but pumpkn :(

lofty mulch
#

newbie dev never read javadoc

languid geode
#

They indeed never do

#

?docs

#

I need a command

#

?commands

#

?help

lofty mulch
#

?suicide

earnest junco
clear iris
#

i know why its deprecated i spent 3 hours trying to get the face of a pumpkin yesterday

#

yes yes directional good

lofty mulch
#

I spent 6 months to understand all Minecraft, Forge, Fabric artifact

#

and now I only understand 30% of them

vast quest
#

thats kinda ur fault

clear iris
#

i spent 2 days learning how to make spigot plugins

lofty mulch
#

welp

clear iris
#

suprisingly very easy

lofty mulch
#

because it has javadoc

clear iris
#

apart from getting the face of a pumpkin

#

yes javadoc good

lofty mulch
#

Minecraft doesnt

vast quest
#

mcwiki

lofty mulch
#

not mcwiki

clear iris
#

so what do you actually do in the minecraft area

lofty mulch
#

coding server

clear iris
#

ah ok

#

but can just download server?

#

from minecraft site

lofty mulch
#

well

#

I mean building a new software based on their

#

like Bukkit did

undone pebble
#

That doesn't support plugins affe

clear iris
#

download off spigot

#

or paper or bukkit

languid geode
#

id say spigot

#

some say paper

#

but here are the docs