#help-development

1 messages · Page 1449 of 1

young knoll
#

BlockBreakEvent

tardy delta
#

there isnt even a persistent data container method in blockstate :/

livid tundra
#

but I need it to work for a mob too

tardy delta
#

Code to execute when a player wants a lock (/protect)

if (cmdName.equals("protect")) {
            if (args.length == 0) {
                Player target = (Player) sender;
                MagmaBuildNetwork.playersWantingLock.add(target.getUniqueId());
                sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&2Right click a chest/ barrel etc to lock it\n Or type /protect cancel"));
            }
            else if(args.length == 1 && args[0].equalsIgnoreCase("cancel")) {
                Player p = (Player) sender;
                MagmaBuildNetwork.playersWantingLock.remove(p.getUniqueId());
                p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&2Cancelled!"));
            }
            else if (args.length == 1 && args[0].equalsIgnoreCase("public")) {
                // TODO add method to make container public (lock.remove)
            }
        }
#

Eventhandler who continue checks if a player executes the command (when executed uuid is added to hashset and eventlistener looks for that)

@EventHandler
    public void onContainerClick(PlayerInteractEvent event) {
        Block block = event.getClickedBlock();
        Player p = event.getPlayer();

        block.setMetadata("MBN", new FixedMetadataValue(plugin, p.getUniqueId()));
        ItemStack itemStack = (ItemStack) event.getClickedBlock();
        NamespacedKey key = new NamespacedKey(plugin, "MBN");


        if (MagmaBuildNetwork.playersWantingLock.contains(event.getPlayer().getUniqueId())) {
            if (event.getAction() == Action.RIGHT_CLICK_BLOCK && block.getState() instanceof InventoryHolder && block.getState() instanceof Lockable) {
                event.setCancelled(true);
                //lock
                itemStack.getItemMeta().getPersistentDataContainer().set(key, PersistentDataType.STRING, p.getUniqueId().toString());

                event.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', "&2Locked!"));
                MagmaBuildNetwork.playersWantingLock.remove(event.getPlayer().getUniqueId());
            } else {
                event.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', "&2This block can't be locked!"));
                MagmaBuildNetwork.playersWantingLock.remove(event.getPlayer().getUniqueId());
            }
        }

    }
tardy delta
#

hmm

young knoll
#

It seems to share all the same subinterfaces as BlockState, so /shrug

tardy delta
#

how?

young knoll
#

How what

tardy delta
#

how to cast and to what?

young knoll
livid tundra
#

do entity events fire for players?

tardy delta
#

lmao to what do i need to cast?

young knoll
young knoll
tardy delta
#

what :/

livid tundra
young knoll
#

Possibly

#

I don't know of any changes a player makes that don't have a specific event though

young knoll
#

This is what you need to cast to

#

Then you can use the linked method

livid tundra
young knoll
olive sluice
#

for(int i = 0; i < 20; ++i) { int spawnLocation = i; }

snow nova
#

im using a schedueler rn but im confsued, I wanna run it for everyone but I also want that everyone sees their location compared to the border so how will I get the player value if no one sends anything?

olive sluice
#

I believe that is just some pretty simple logic your are needing

sharp bough
olive sluice
#

i would check which side of the border the player is closest to, and get the distance to that location by location#getDistance()

sharp bough
#

join quit message

#

kits

#

warps

#

perms and locations

olive sluice
#

this would 100% be easier tham perms

#

and kits probably

#

but i agree

#

start simple

snow nova
#

I already figured how to get the distance value im just not sure how to display it for everyone

olive sluice
#

ah

sharp bough
#

you should loop the players

young knoll
#

Loop all players in the scheduler

olive sluice
#

well cycle through all online players and set their actionbar

young knoll
#

Calculate their distance, show it to them

olive sluice
#

for (Player player : Bukkit.getOnlinePlayers())

snow nova
#

okay I will try that thanks a lot

olive sluice
#

something like that

quaint mantle
#

bro

#

This work only if you have op

snow nova
#

thanks for the help the plugin works now I appreciate it

quaint mantle
#

How?

#

an

quaint mantle
#

Can you edit the code for me pls

#

@EventHandler (priority = EventPriority.HIGH)
public void onPlayerDeath(PlayerDeathEvent event) {
event.getDrops().removeIf(is -> is != null && is.getType() != Material.DIAMOND_PICKAXE);
}

#

Like this?

#

TY

sharp bough
#

how could i enter a case in a switch if its int?

#

like case isInt(args[2]) :

young knoll
#

You don't

quaint mantle
#

In console log?

young knoll
#

You use if

quaint mantle
#

Not work same rip

sharp bough
#

so ``` switch (args[0]) {
case "add":
switch (args[1]) {
case "location":
player.sendMessage("adding location");
return true;
case "loot":
if(isInt(args[2])) player.sendMessage("addming loot");
return true;
}
}

#

would that brake?

#

with index out of bounds

quaint mantle
#

and then what do I do?

young knoll
#

Yes

#

You need to check the length of args before you try to access them

sharp bough
quaint mantle
#

ah

young knoll
sharp bough
#

to not check

#

nvm i figured it out tho

young knoll
#

You could catch the exception I guess

sharp bough
#

thank

young knoll
#

But like, please don't

sharp bough
#

hahaha

quaint mantle
#

` @EventHandler
public void onDropEvent(PlayerDropItemEvent e) {
Player player = e.getPlayer();
Item it = e.getItemDrop();
ItemStack is = it.getItemStack();

    if(it != null && is != null && is.getType() != Material.AIR) {
        if(is.getType() == Material.DIAMOND_PICKAXE) {
            e.setCancelled(true);
            String Drop = plugin.getConfig().getString("Drop");
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', Drop));
        }
    }
}`
#

I made this code, but when I use Q in inventory it gives me an error in console and moves my pickaxe to other slots, how do I get it back to the first slot?

neon nymph
#

Would it be wise to store user data for your plugin in pdc? e.g. in essentialsX, they got their user data in individual yaml files, couldn't they just store em in pdc for each player's data? Or did I misunderstand how pdc works

quaint mantle
#

That is?

marble granite
#

so, i am trying to make a custom tablist, and want to remove all players first. i use this code for that:
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER ,worldserver.getPlayers());
problem is; it removes the player for the client (it dopesnt render it) how do i make it so it only deletes the tab?

neon nymph
marble granite
#

basically, yes

hollow canopy
#

guys Are there any usable thing for all colors? I mean how can I use Coloured with lore?

#

It will work for all colors I mean

marble granite
#

player join event, delayed 1 second

neon nymph
#

You don't need to do all that, just create a new arraylist and return that in your onTabComplete event

marble granite
#

(1.16.4) by the way

neon nymph
#

Also check out the XY problem

marble granite
#

wait no i mean

#

FUCK NO MSG PERMS

#

caps

#

the player list

#

'the tab list

#

whnen you press tab

marble granite
quaint mantle
#

[19:14:06] [Server thread/ERROR]: Could not pass event InventoryCreativeEvent to BlockPickaxe v1.0
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[server.jar:git-TacoSpigot-bf023c7d]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[server.jar:git-TacoSpigot-bf023c7d]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[server.jar:git-TacoSpigot-bf023c7d]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [server.jar:git-TacoSpigot-bf023c7d]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [server.jar:git-TacoSpigot-bf023c7d]
at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1821) [server.jar:git-TacoSpigot-bf023c7d]
at net.minecraft.server.v1_8_R3.PacketPlayInSetCreativeSlot.a(SourceFile:23) [server.jar:git-TacoSpigot-bf023c7d]
at net.minecraft.server.v1_8_R3.PacketPlayInSetCreativeSlot.a(SourceFile:9) [server.jar:git-TacoSpigot-bf023c7d]
at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [server.jar:git-TacoSpigot-bf023c7d]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_292]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_292]
at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [server.jar:git-TacoSpigot-bf023c7d]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:808) [server.jar:git-TacoSpigot-bf023c7d]
net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:645) [server.jar:git-TacoSpigot-bf023c7d]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]
Caused by: java.lang.NullPointerException
at BP.ItemBlockEvent.onClickEvent(ItemBlockEvent.java:28) ~[?:?]

neon nymph
#

Ohh the tab list, mb

marble granite
#

dw lol

quaint mantle
#

line 28?

#

if(current.getType() == Material.DIAMOND_PICKAXE) {

neon nymph
marble granite
#

According to the third post in this thread, if the player isn't in the tab list it will not be rendered (1.8+)

#

wynncraft does it

neon nymph
#

Haven't done that myself, but from my experience with other plugins with NPCs, their names appear for a split second before it disappears when the player goes near them

#
  • Use the PlayerMoveEvent, only check from block changes & check the radius. If they're within the radius remove them again so you don't have to constantly remove them with a repeating task.
#

I guess that's what this is talkign about

karmic sapphire
#

Hey Gecko, I actual got my weird question solve, the one every one sed cant be done 😝

marble granite
#

any player, so apparantly, that packet is effectively a destroy packet

quaint mantle
#

Help me pls

chrome beacon
marble granite
chrome beacon
#

;/ replied to the wrong message

marble granite
#

if that isnt considdered skidding lol

quaint mantle
chrome beacon
#

current is null

neon nymph
quaint mantle
#

ItemStack current = e.getCurrentItem();

chrome beacon
#

Yeah current item is null ;/

quaint mantle
#

ah

#

How can I fix

chrome beacon
#

And an if check

marble granite
#

ah f*ck its using custom objects

quaint mantle
marble granite
#

lol im new to NMS, this all is a bit confusing to me

sharp bough
#

does the * enable all perms that go after the chest.?

  chest.*:
    children:
      chest.add.item: true```
#

i have that

#

and 3 perms

#

chest.add.item

#

chest.add.loot

#

and chest.add.location

quaint mantle
#

pls help me

sharp bough
#

when i set chest.* to true

marble granite
#

ill use protocollib, i guess. makes it a bit easier. i have heard bad things about it though..

sharp bough
#

i can add locations and loots

#

even tho the chest.* only has chest.add.items as children

marble granite
#

you cant have .s in your path

sharp bough
#

i have seen this same example a few times

quaint mantle
#

Ehy

marble granite
#

but, i will need to resend the tab each time a player joins, right?

quaint mantle
#

Can u help me?

marble granite
#

correct me if im wrong but, basicallt: player gets removed > player enters chunk of other player > player gets added?

heady garden
#

running a SignChangeEvent to see if any line of a sign contains certain text

#

for (String line : sign.getLines()) {
this.plugin.sendMessage(event.getPlayer(), line); }

#

i run that to get the contents of the lines

#

but they send as blank?

#

no matter what type of sign i use and what text

quaint mantle
#

How do I see if it is null?

heady garden
#

It sends four empty lines

quaint mantle
marble granite
#

ah, thank you!

quaint mantle
#

ok

#

ok

heady garden
#

just tried, and yes

#

4 empty lines in console

quaint mantle
#

Ok now it doesn't give me more error

#

But the part where I have to hold the pickaxe even after death doesn't work

heady garden
#

weird enough, if I check the lines on the sign on a BlockBreakEvent, it works properly...

#

Perhaps im using the wrong event

quaint mantle
#

I tried to remove all plugins

heady garden
#

player placing

quaint mantle
#

How can I do?

heady garden
#

no other plugins installed

#

1.16.5

quaint mantle
#

This part @EventHandler (priority = EventPriority.HIGHEST) public void onPlayerDeath(PlayerDeathEvent event) { event.getDrops().removeIf(is -> is != null && is.getType() != Material.DIAMOND_PICKAXE); } not work

chrome beacon
#

And what's the error?

#

or what happens?

quaint mantle
#

No errors, just that when I die without op my pick is lost

#

Only works with op

chrome beacon
#

Op doesn't affect that code

quaint mantle
#

ik

chrome beacon
#

Make sure you don't have another plugin messing with drops

heady garden
#

Even if i do:

#

this.plugin.sendMessage(event.getPlayer(), sign.getLine(0)); this.plugin.sendMessage(event.getPlayer(), sign.getLine(1)); this.plugin.sendMessage(event.getPlayer(), sign.getLine(2)); this.plugin.sendMessage(event.getPlayer(), sign.getLine(3));

#

it still sends empty lines ;///

quaint mantle
#

I have already tried to disable everything with plugman

chrome beacon
#

Don't use PlugMan

quaint mantle
#

ah

chrome beacon
#

Delete plugins and restart

quaint mantle
#

bruh

heady garden
#

could you show me how you did that?

#

this is so weird ;////

#

that worked

#

what the heck

#

what did i do differently

#

1...

#

Sign sign = (Sign) event.getBlock().getState();

#

thats probably why...

#

it used to be a blockplaceevent

chrome beacon
#

Yeah the event fires before the sign is actually changed

heady garden
#

;-;

#

dammit

#

thanks so much lol

opal juniper
#

It is possible to make a custom 'Monument' to spawn in the world?

#

It would span over more than one chunk ideally

#

I would assume you would use the 'ChunkLoadEvent' or something

#

However, im not too sure if this is very possible

chrome beacon
#

Custom structures are possible but a mess to make

opal juniper
#

Is that cause of the terrain?

#

like making them look gd

#

What is happening?

#

ok..... im not sure how much this really helps

#

what is happening in 1.17 or do you think it will break things like this?

bitter mural
#

hey so I just used Location.setDirection(Vector) for the first time. Goal: teleport the player to the location, with their pitch and yaw looking at a block. Result: teleports the player to the location looking the exact opposite direction of the block.
Does anyone know what I'm missing here?
I know I can multiply the direction by -1 to fix it, but I'm confused why I need to.

opal juniper
#

riiiight, ok

south onyx
#

when i do a crafting recipe
i want the result to be a chest that has stuff inside of it

#

how do i put items inside a chest that is an itemstack?

eternal oxide
#

an unplaced chest has no inventory

chrome beacon
#

What error

severe night
#

which better performance ?

chrome beacon
#

Yeah I see what the issue is

#

You're checking if the sender isn't a player

#

Then you're forcing it to be a player and sending the message anyway

#

Causing that error

eternal oxide
#

You are casting to Player without checkign first

severe night
south onyx
#

when they place the chest

#

how do i add stuff to its inventory

chrome beacon
#

Don't use the player object when the sender isn't a player

#

Use the sender object

eternal oxide
#

Its still going to error because you are casting sender to Player without checking first.

#

instanceof

chrome beacon
#

He's already doing the check

quaint mantle
#

Removed all the plugins, I only have mine but I still drop the pickaxe !!

chrome beacon
#

But casting before it

quaint mantle
#

@chrome beacon @quaint mantle

eternal oxide
#

he's doing the test After he creates his player variable and casts

chrome beacon
#

?

quaint mantle
#

No

chrome beacon
# quaint mantle No

Then why did you make the code so it would delete everything but the pickaxe

#

Change != to ==

eternal oxide
#

you can;t create your player object without checking instanceof first.

quaint mantle
eternal oxide
#

so only create your player variable when you know it IS a player

quaint mantle
chrome beacon
quaint mantle
#

public void onPlayerDeath(PlayerDeathEvent event) {
event.getDrops().removeIf(is -> is != null && is.getType() != Material.DIAMOND_PICKAXE);
}

#

to

#

public void onPlayerDeath(PlayerDeathEvent event) {
event.getDrops().removeIf(is -> is != null && is.getType() == Material.DIAMOND_PICKAXE);
}

chrome beacon
#

Yes

quaint mantle
#

ok

#

the same

#

I said I didn't want the pickaxe to fall, always in the inventory

#

How can I do?

chrome beacon
#

Yeah you need to add the pickaxe back when the player respawns

#

Now you just removed it from the drops

quaint mantle
#

Bruh

#

Sorry for the inconvenience

#

How can I do?

chrome beacon
#

I'm not spoonfeeding you code

quaint mantle
#

?

chrome beacon
#

but use the PlayerRespawnEvent and then add the item back

#

You might have to delay that with one tick not sure tbh

quaint mantle
#

Yes, but this is an UltraPrisonCore pickaxe

chrome beacon
#

and?

quaint mantle
#

With enchant

chrome beacon
#

yeah and?

#

You can still do that

quaint mantle
#

ok

quaint mantle
scarlet path
#

I was wanting to use PlayerPickupItemEvent but its depraced is there another way I can see if a player picks up an item?

eternal oxide
#

look at the javadoc for it

scarlet path
#

thanks

#

okay thanks

quaint mantle
eternal oxide
# quaint mantle .

We are not writing the code for you. If you have a problem or an error we can help.

quaint mantle
#

Ok

south onyx
#
@EventHandler
    public void onPlace(BlockPlaceEvent e) {
        if (e.getBlockPlaced() instanceof Chest) {
            Chest chest = (Chest) e.getBlockPlaced();
            chest.getBlockInventory().addItem(new ItemStack(Material.ACACIA_BOAT));
        }
    }
#

why isnt this working?

#

when i place the chest and open it there are no errors

#

but there is no boat in it

eternal oxide
#

.getState instanceof Chest

south onyx
#

ok

quaint mantle
#

Dammit

#

Beat me to it

eternal oxide
#

you can;t cast a block directly to a Chest

#

only a BlockState or BlockData

south onyx
#

ok thx

elder ferry
#

Has anyone here worked with lighting before? I'm working on a method to change blocks faster (very original not done to death idea, i know) and i can't for the life of me get lighting to update properly. i looked at paper's fix-light-command patch and got it somewhat working, but it doesn't update everything. This is what i'm doing atm, ```java
LightEngineThreaded lightEngine = (LightEngineThreaded) world.getChunkProvider().getLightEngine();
for (Block b : blocks) {
lightEngine.a(new BlockPosition(b.getX(), b.getY(), b.getZ()));
}
lightEngine.queueUpdate();

and here's a video of what it does:
south onyx
#
public class TrapCrates extends JavaPlugin implements Listener {
    ItemStack trapItem;
    @Override
    public void onEnable() {
        trapItem = new ItemStack(Material.CHEST);
        ItemMeta trapItemMeta = trapItem.getItemMeta();
        trapItemMeta.setDisplayName(ChatColor.DARK_PURPLE + "Trap Crate");
        trapItem.setItemMeta(trapItemMeta);
        ShapelessRecipe trapRecipe = new ShapelessRecipe(new NamespacedKey(this, "trap"), trapItem);
        trapRecipe.addIngredient(Material.CHEST);
        trapRecipe.addIngredient(Material.TRIPWIRE);
        Bukkit.addRecipe(trapRecipe);
        Bukkit.getPluginManager().registerEvents(this, this);
    }
    @EventHandler
    public void onPlace(BlockPlaceEvent e) {
        if (e.getBlockPlaced().getState() instanceof Chest && e.getPlayer().getInventory().getItemInMainHand().equals(trapItem)) {
            Chest chest = (Chest) e.getBlockPlaced().getState();
            chest.getBlockInventory().addItem(new ItemStack(Material.ACACIA_BOAT));
        }
    }
}
#

this is what i have

#

it doesnt work

#

when i do the crafting recipe it justs gives me a trapped chest

#

and when i place the trapped chest it doesnt give me the boat

#

ok thx

#

but i want to check if the chest is trapItem

#

trap item is an itemstack

#

then how do i check?

#

i want to check if the block display name is something

#
@EventHandler
    public void onPlace(BlockPlaceEvent e) {
        if (e.getBlockPlaced().getState() instanceof Chest) {
            Chest chest = (Chest) e.getBlockPlaced().getState();
            chest.getBlockInventory().addItem(new ItemStack(Material.ACACIA_BOAT));
        }
    }
#

same thing

opal juniper
elder ferry
#

yeah

opal juniper
#

I think that you have to bear in mind, light updates are really expensive

elder ferry
#

fully aware, i can design a system to spread out the load, just need to figure out how to actually update it first

opal juniper
#

So that lag, is most likely due to you looping thru every block

#

Iirc, there is a method to send a chunk light update

#

Although I completely forget where

#

Afaik, this is the better way to do it, rather than blockwise

#

Yeah, it is a pain

#

I remember a while back I made a method that just sent a new light update for a chunk, however I just deleted it as I changed the approach I was using

#

U have to get the lighting provider or sommin

#

<

#

I’m not sure if I like that

elder ferry
#

that causes a lot of client side lag then since it's computing it all, no?

#

i don't mind going deep into nms, i'm not looking for an easy solution to my problem

opal juniper
#

Is it possible, to hack nms enough to get a custom mob in the /summon list?

#

Like an actually custom mob

elder ferry
#

relogging or flying away and coming back fixes the lighting, so not entirely sure what that means but it's somethin haha

opal juniper
#

What is it with you and spamming packets lmao

#

I don’t have to

#

U*

#

Not for everything

#

Calm down

#

😆

#

Yeah Ik why you mean

#

Fair

#

But, ehh

#

I remember this was one of those page ten of google type problems

elder ferry
#

yeah i am sending that packet, just giving it the chunks pos, light engine, and false

opal juniper
#

Ok

elder ferry
opal juniper
#

Yeah, it took me several hours to fix

#

Have you asked in paper discord?

elder ferry
#

nah guess i can try there

opal juniper
#

They tend to know a lot of stuff on the technical side

#

(Not that People here don’t)

eternal oxide
#

We all dumb as shit

opal juniper
#

Yuhuh

paper viper
#

lmao

sullen marlin
#

?kick @wraith rapids

queen dragonBOT
#

👢 Kicked NNYaKNpGms0eUVpiSdHx#5618

sullen marlin
#

?kick @quaint mantle

queen dragonBOT
#

👢 Kicked NNYaKNpGms0eUVpiSdHx#5615

sullen marlin
#

?kick @limpid pumice

queen dragonBOT
#

👢 Kicked NNYaKNpGms0eUVpiSdHz#3326

compact haven
#

wtf why so many of him

sage swift
#

what did he do wrong

eternal oxide
#

He's the kicking boy

cold pawn
#

what method do I have to call to make a command that opens another players gui?

onyx shale
#

wut

subtle kite
#

what is the gui

onyx shale
#

player.openInventory

ebon crescent
#

How do you add a location to a map?

paper viper
#

?

#

wdym

ebon crescent
#

No, a minecraft map

#

Not a hashmap

quaint mantle
#

You mean like a map marker?

ebon crescent
#

Yeah probably

#

Is there any way to track locations in the word and navigate to them using the map

#

I’ve tried looking at the mapcanvas class but I don’t need that much customization

#

I just need to be able to add a marker that is located at a certain Location

onyx shale
#

set the cursor at that point

#

and disable tracking?

quaint mantle
#

Banners show on the map as markers

#

So maybe you can use that somehow

wraith rapids
#

see the MapMeta class

paper viper
#

you can also modify the map pixels manually

#

and send map packets to users if you want

#

for custom icons

dire marsh
#

maps are really powerful

paper viper
#

yes

wraith rapids
#

you can add arbitrary text and markers to them

paper viper
#

they also update very quickly too

#

like extremely quickly

dire marsh
#

I've messed with them in the past and they are very cool

wraith rapids
#

resending the entire map repeatedly can supposedly use quite a bit of bandwidth

dire marsh
#

zzz get gud internet

paper viper
#

lol

wraith rapids
#

i remember one 'minimap' plugin that used maps facing bandwidth issues

paper viper
#

but yes that is true

ebon crescent
#

Yeah, I’ve been looking into them for the past couple days and I do see that they’re quite powerful

#

But I was having a hard time determining whether there’s a simple way to track a couple of pre-set locations

wraith rapids
#

pretty sure the MapMeta and MapView classes let you do that pretty trivially

ebon crescent
#

I like the banner idea, thanks for that. And I’ll look into the Cartogropher project

#

No, not that I can tell

#

You have to write a renderer I believe, and I don’t see a way to do that without drawing the entire map object

#

I am relatively new to spigot though so I could be weong

#

Wrong*

wraith rapids
#

you'd think there'd be some sort of api for it but i guess bukkit is pretty incomplete around some of the more recent parts

#

but yeah it doesn't look like there is anything sane for it in the api

dire marsh
#

cough cough legacy compatibility

paper viper
#

you can do it with packets

wraith rapids
#

is there something you can't do with packets

ebon crescent
#

^

paper viper
#

pass in byte array for data values

#

for the colors

#

i beleieve its like

#

let me search the packet name

#

PacketPlayOutMap

#

you cant actually pass a byte[]

#

you pass in the color for each pixel

ebon crescent
#

Yeah, I think I’ll just spawn invisible banners and let the Minecraft server take care of the rest

fierce salmon
#

@Override giving me an error :(

paper viper
#

its not a lib i dont think

#

its just a plugin

#

but its very performant

ebon crescent
paper viper
#

like extremely

#

it goes into Bitsets

#

and MipMaps

fierce salmon
#

oh im so fucking stupid

sullen marlin
warm vapor
#

is there a way I can add buildtools as a dependency with gradle/maven?

sullen marlin
#

as in buildtools itself?

warm vapor
#

I need nms but this is not provided by the spigot api alone

sullen marlin
#

yes it does

paper viper
#

add spigot as artifact

sullen marlin
#

^

paper viper
#

it also installs into maven local tho

warm vapor
#

can I avoid having to manually add artifacts? it would be easier to have it similarly to how I have spigot:
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT' from my build.gradle

paper viper
#

again, from what i said:

#

compileOnly 'org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT'

#

try this

#

for nms

fierce salmon
warm vapor
sullen marlin
#

did you run buildtools

#

is gradle set to use your local maven repository

paper viper
#

mavenCentral()

#

wait

#

not that

#

i meant

quaint mantle
#

mavenLocal()

paper viper
#

im stoopid

#

lol

#

yeah i meant that

#

xD

warm vapor
paper viper
#

you dont really need the output

fierce salmon
#

how do you set the slot of an item in an inventory

paper viper
#

have you tried looking at the javadocs?

ripe marlin
#

Just finished java, what is a good way to go about learning spigot

fierce salmon
#

@paper viper how would you do that here?

paper viper
#

you tell me

sullen marlin
#

@warm vapor that page says ' // mavenLocal() // This is needed for CraftBukkit and Spigot.' uncomment it

paper viper
#

Im not spoonfeeding

#

lol

#

what is your goal?

warm vapor
sullen marlin
#

did you run buildtools

warm vapor
#

yes

paper viper
#

did it finish?

sullen marlin
#

idk then, I dont use gradle

#

did you reimport the project or whatever rubbish intellij makes you do

warm vapor
#

I could try rthat

fierce salmon
#

maveners amirite

paper viper
#

i actually use both

ripe marlin
#

but seriously is there a good api page on spigot or...

quaint mantle
#

same, I think both have their advantages

warm vapor
#

gradle seems much more concise than maven

sullen marlin
#

?jd

paper viper
#

just google if you have a quesiton lol

#

chances are

#

you will meet the spigot forum post

#

or bukkit forums

paper viper
#

but idk

#

thats just for me

sullen marlin
#

?kick @wraith rapids rr 1.1, 3.3

queen dragonBOT
#

👢 Kicked NNYaKNpGms0eUVpiSdHx#5618

warm vapor
#

Take note that to use NMS you need to have run BuildTools for the appropriate version locally, in such a way it is found located under ~/.m2.
where is this .m2 directory?

sullen marlin
#

in your user dir

paper viper
#

lmao 6th kick xD

vagrant stratus
#

linux, well no idea 🤷‍♂️

warm vapor
#

it has bukkit, craftbukkit, spigot but my project still does not recognize them

#

I do also need nms but I can't find that in my m2

sage swift
#

C:/Users/you/.m2

quaint mantle
#

nms is included in craftbukkit/spigot

warm vapor
#

in that case I really don't know what I am missing that none of these are recognized with my build.gradle setup

sullen marlin
#

try building with the command line not your ide?

warm vapor
#

I'm not trying to build, I am trying to get the ide to add the dependencies so that when I am programming they are not highlighted as errors

sullen marlin
#

did you reimport it

warm vapor
#

yes

#

reimporting has never been necessary with my other gradle projects

elder ferry
warm vapor
#

if I use maven instead of gradle is there anything extra I need in the pom xml besides what the wiki provides?

#

(besides running BuildTools)

sullen marlin
#

no

warm vapor
#

I still have a ton of unresolved symbols using maven
idea gives me the option to add maven dependencies but this adds spigot 1.12

south onyx
#

everything works

#

except the recipe

#

it gives me a trapped chest instead of the trapItem ItemStack

granite stirrup
#

did u seriously put everything in the main file ;-;

south onyx
#

well yeah

#

i didnt need another class

granite stirrup
#

but i mean

south onyx
#

im only using one event

granite stirrup
#

its bad practice just putting everything into one file

south onyx
#

ik

#

but for only one event???

granite stirrup
#

i guess its fine for now

south onyx
#

anyways can you help me with my problem?

#

idk whats wrong

#

ive even tried the prepare item crafting event

granite stirrup
#

i dont know if that recipe works with named results

south onyx
#

oh

#

hmm

granite stirrup
#

¯_(ツ)_/¯

#

i never tried making a recipe

#

in spigot

#

so u might be able to do it but i dont know how

warm vapor
#

I actually had an error while running BuildTools that I didn't notice: https://hatebin.com
I don't know what the compilation error means, but I have set the git user.name and email now and previously but this changed nothing

warm vapor
#

it is in the hatebin link

#

happens after all of the patches

granite stirrup
#

u forgot the file

#

;-;

#

did u forgot to save it

warm vapor
#

I wish it would tell me when there are too many characters

granite stirrup
#

¯_(ツ)_/¯

warm vapor
granite stirrup
#

wait for buildtools dont u just run the application?

#

¯_(ツ)_/¯

#

i think u need to put ur github name and email

#

tho

warm vapor
#

I have done that with the commands it says
is there somewhere else I should put them?

granite stirrup
#

did u replace the email to ur email and replaced the name to ur name for github

warm vapor
#

yes

#

it gave me the same output

granite stirrup
#

idk then ¯_(ツ)_/¯

rare hazel
#

does anyone know if its possible to connect direct to a server instead of to the BungeeCord main server... atm when i try to join on of the server that is not the main BungeeCord server i get "If you wish to use IP forwarding, please enable it in your BungeeCord config as well!"

granite stirrup
#

in the config

#

for bungeecoord

#

it should be called ip-forwarding

rare hazel
#

yes i have that to ture, that why i can join the main BungeeCord server, but is ther a option for the other servers in the cluster?

granite stirrup
#

did u restart the bungeecoord

#

after u changed it

rare hazel
#

have restarted them all like a 1000 times :/

granite stirrup
#

k then just connect via bungeecoord?

#

if u want to connect to a different server when u join just do bungee ip:port

rare hazel
#

im useing a plugin that changes the server icon when pinging the server, cant use it on the main bungee thing atm.. they dont have the option to code that

granite stirrup
#

then find another one if it doesnt work for bungee

#

lol

rare hazel
#

lol, i made the plugin and bundgee dont have the function i need in the library 😦

sullen marlin
#

if you can join the servers directly your bungee setup is broken and insecure

#

and pointless

granite stirrup
#

also u can also just connect with the bungeecoord and a port

sullen marlin
#

and bungee absolutely has a setFavicon method

granite stirrup
#

;-;

eternal oxide
#

No one ever follows teh guide past the installation section

granite stirrup
#

lmao what

rare hazel
#

cant find it in the bungee documentation

#

thye have the on ping evnet, but cant change the server icon with it

sullen marlin
#

ProxyPingEvent.getResponse().setFavicon

rare hazel
#

is setFavicon the smae as server icon?

sullen marlin
#

yes

rare hazel
#

thank you!!!!

granite stirrup
rare hazel
#

@idkidk123123 true, but i saw a server that had it and i got obsessed to make it my self....

granite stirrup
#

lmao

#

mod menu is weird

#

has anyone btw gotten optifabric working

#

i never got it working

#

;-;

#

it just crashes

#

without a proper error message, error code or logs

#

just code 0

finite shore
#

does anyone know a way i can make a plugin that applies a certain potion effect when i right click it with a cooldown?

#

a CustomModelData item

#

ive never made a plugin before i was just wondering if it was an easy thing to do ;-;

subtle kite
#

send a message to the player when they join the server.?

finite shore
#

?

subtle kite
#

oh I only read the 2nd part

granite stirrup
#

bye

#

gtg

finite shore
#

does anyone know an easy way of doing it

subtle kite
#

getItem().getItemMeta().equals()

finite shore
#

uhhh how does one

#

thank you very very much, now I have to look up how to make it a plug-in

#

and shove it in the server

subtle kite
#

@quaint mantle you just spooned feed lemon and he doesn't even have a program to make a plugin ...lol

sage swift
#

oh we're not spoonfeedin?

#

my bad

subtle kite
#

yeah

#

skeleton.getKiller().getInventory().addItem(Material.DIAMOND_BLOCK)
how would I make it 64 block instead of 1

rare hazel
#

@sullen marlin Thank you so much for the info!! Finally got it to work!!

sage swift
#

i've seen a table of contents in some written books. is this possible programmatically?

ripe marlin
#

Can some1 explain gradle to me and why it should be used in spigot

paper viper
#

gradle?

ripe marlin
paper viper
#

Gradle is an example of a build management software. It isn't only limited to Spigot, but also usually used in other general projects that rely on dependencies. Another example of a popular build management software is called Maven. There isn't really one you "should" particularaly use for Spigot projects, as both are viable.

As in for build management, the basic idea is that you specify dependencies that your project relies on, as well as settings such as the compiler settings to tweak, general java settings, or other stuff. One of the most useful features is shading.

ripe marlin
#

Kk thx

granite stirrup
#

It is

#

There's a text action in a book I think and it's called change_page

ripe marlin
#

Btw is this a good thing to use as a beginner https://youtu.be/Om5Kon5WpV8

Hey guys! Today I am showcasing my famous Minecraft Craftbukkit / Spigot Plugin Template! With it, you can get right to making the fun stuff instead of fiddling with the annoying behind the scenes work. Also, using this template got my plugins immediately approved on SpigotMC, so you know everything is implemented according to proper OOP princip...

▶ Play video
granite stirrup
#

Idk

ripe marlin
#

I’m guessing not

#

@paper viper too much automation for beginner?

granite stirrup
granite stirrup
warm vapor
#

do I need to be using java 8 for the buildtools setup to work?

granite stirrup
#

No

#

I don't think so

dusk flicker
#

If I recall it supports up to Java 15

#

Thats the last I knew of it, may support newer now

granite stirrup
#

Ik 1.16 supports java 16

#

I think

dusk flicker
#

Im talking about buildtools

granite stirrup
#

Same

#

I'm talking about 1.16 buildtools lmao

granite stirrup
#

Above 8

#

8-16

#

I think

dusk flicker
#

Just checked myself in the source code of BuildTools

#

max atm is 16

#

That was updated a few months ago

sage swift
#

wtf you cant use java 16 with 1.17

#

it has to be java 17

granite stirrup
#

Wdym java 17 isn't out???

sage swift
#

they better release it for 1.17!!!

granite stirrup
#

No lol

dusk flicker
sage swift
#

BRO thats the WRONG number of o's!!!!!

dusk flicker
#

thats literally the subreddit for it

#

lol

#

oh fuck

#

I just did it didn't I

sage swift
#

reddit tier

warm vapor
#

I got the buildtools to run successfully but it doesn't seem to be putting the 1.16.5 craftbukkit jar in my m2 directory
it just generates the spigot jar and that is all

#

maven doesn't add nms or craftbukkit as external libraries

dusk flicker
#

It doesn't build craftbukkit anymore

#

It says that on the page I believe

#

There may be a flag to enable it

warm vapor
#

I found it
--compile craftbukkit

#

will this also cover nms?

unkempt peak
#

just convert the args to the effect type time and level

#

there are many ways to do that
if args is speed
add speed
if args is jump_boost
add jump boost

or for a more efficient way create a hashmap with the potion name as the key and the potion effect as the value

#

hmm

#

yeah

#

also you could loop through PotionEffectType#values and put the effect type with PotionEffectType#toString@quaint mantle

#

thanks

#

i just noticed yours lol

#

Grogu is the best

warm vapor
#

is there a specific place that the plugin yml needs to be in

#

mine is in the jar but the server says it isn't

unkempt peak
#

it needs to be in your src

warm vapor
#

it is

#

I put it in src/resources and that didn't work even though it was in the jar
now I moved it to src and it hasn't shown up in the jar

unkempt peak
#

send a screenshot

warm vapor
#

inside the jar:

warm vapor
#
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:170) ~[spigot.jar:3082-Spigot-9fb885e-d49530f]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:144) ~[spigot.jar:3082-Spigot-9fb885e-d49530f]
    at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:381) ~[spigot.jar:3082-Spigot-9fb885e-d49530f]
    at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:224) ~[spigot.jar:3082-Spigot-9fb885e-d49530f]
    at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:928) ~[spigot.jar:3082-Spigot-9fb885e-d49530f]
    at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[spigot.jar:3082-Spigot-9fb885e-d49530f]
    at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml

maybe it is something within the plugin yml?

somber hull
#

?paste

queen dragonBOT
somber hull
#

if anyone wants to yell at me and compile a list fo things im doing wrong, please do

#

just dm me what i need to fix

candid galleon
#

is BlockState thread safe?

candid galleon
#

Ty

somber hull
quaint mantle
#

Can you help me with the fact that when I die I never have to lose the pickaxe?

somber hull
#

?paste

queen dragonBOT
somber hull
#

dm me if theres anything i can fix here

sullen marlin
topaz atlas
#

Eclipse is not working

#

what should I use?

sullen marlin
#

what part of it is not working

topaz atlas
#

Want the error log?

#

Installation. I uninstalled it to install something else and now it wont install.

#

@sullen marlin

sullen marlin
#

sure

topaz atlas
sullen marlin
#

delete C:\Users\shikh.p2\ and C:\Users\shikh\eclipse\ before trying again maybe?

#

also you just need eclipse for java developers, not the enterprise/webdev one

topaz atlas
#

I cant access C:\Users\shikh.p2\

#

I deleted the other one

eternal oxide
#

check your task manager to make sure eclipse isn't still running

topaz atlas
#

Failed again

#

I think I should just install an alternative and report the issue to the devs

#

So what should I use?

sullen marlin
#

C:\Users\shikh.p2\

#

C:\Users\shikh\.p2\

#

not sure why discord removed the \ originally

#

delete C:\Users\shikh\.p2\ and C:\Users\shikh\eclipse\ before trying again maybe?

topaz atlas
#

So the .p2 or the contents?

sullen marlin
#

whole folder, remove both of those

topaz atlas
#

Fixed

#

Thank you

quaint mantle
#

I created this code only that when I respawn I get a new pickaxe and not one with the enchants from before

#

` @EventHandler
public void onPlayerRespawn(PlayerRespawnEvent e) {
pickaxe(e.getPlayer());

}

private void pickaxe (Player p) {
    PlayerInventory inv = p.getInventory();
    inv.clear();
    inv.addItem(new ItemStack(Material.DIAMOND_PICKAXE));
}`
#

I want the pickaxe back from before with enchant

eternal oxide
#

You get a new Pickaxe because you are creating a new ItemStack and not giving the item you lost on death

quaint mantle
#

And how do I get the old pickaxe?

#

public void onDropEvent(PlayerDropItemEvent e) {
Player player = e.getPlayer();
Item it = e.getItemDrop();
ItemStack is = it.getItemStack();

    if(it != null && is != null && is.getType() != Material.AIR) {
        if(is.getType() == Material.DIAMOND_PICKAXE) {
            e.setCancelled(true);
            String Drop = plugin.getConfig().getString("Drop");
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', Drop));
        }
#

from this for example

tacit drift
#

on death

quaint mantle
#

ok

tacit drift
#

get inventory

#

search for the item with that nbttag

#

copy it to a itemstack

eternal oxide
#

don;t use nbttags

quaint mantle
#

an

tacit drift
#

and add it to the inventory

tacit drift
#

:))

quaint mantle
#

And I lose the enchants like that?

eternal oxide
#

get the item you want to copy in the death event...

tacit drift
#

and how would he find it?

quaint mantle
#

public void onPlayerDeath(PlayerDeathEvent event) {
event.getDrops().removeIf(is -> is != null && is.getType() == Material.DIAMOND_PICKAXE);

}
eternal oxide
#

he keeps a copy of it in memory to add back to teh player upon respawn

quaint mantle
#

this is death event

#

so what do i do to get the old item?

eternal oxide
#

is it a specific pick or all diamond picks?

#

currently you seem to be checking for all diamond picks

quaint mantle
#

is a diamond pickaxe with plugin enchants

tacit drift
#

so

#

it's a pickaxe made by another plugin?

quaint mantle
#

Nop

#

it's a normal pickaxe only enchants can be added

eternal oxide
#

You create it?

tacit drift
#

and are custom enchants or vanilla?

quaint mantle
#

custom enchants

tacit drift
#

what plugin

quaint mantle
#

UltraPrisonCore

#

for example JackHammer

#

or explosive

#

What can I do?

tacit drift
#

hmm

eternal oxide
#

Is it just the one pick you are trying to give back to teh player? or all custom picks?

tacit drift
#

You could make a list of all the enchantments from the plugin

#

With ultraprisoncore api

quaint mantle
#

ah

tacit drift
#

chech with hasEnchant if the item has one of the enchantments from the list

tacit drift
#

if it does, copy it

#

oh

eternal oxide
#

If its just one I'd store a clone in a map against the players UUID upon death. Then give it back upon respawn

tacit drift
#

👍

quaint mantle
#

You can only have a pickaxe with certain enchants, if you die I want the enchants to return to the pickaxe

tacit drift
#

on death, loop thru inventory, check for every item if it has the name, material and all enchants that the pickaxe that you are looking for has

#

store the item and player name/uuid in a hashmap (as elgarl said)

#

and on respawn, check if player uuid is in hashmap, if he is, get value from the key (player uuid)

#

and add item to inventory

eternal oxide
#

Map<UUID, ItemStack>

tacit drift
#

👍

quaint mantle
#

I understand little

tacit drift
#

or if you know a way to

#

add a special nbttag to the item when it's created

#

and check only for that tag

#

instead of name material enchants

eternal oxide
#

He's not ok with Maps, he'd no way handle nbt. He should use PDC over nbt anyway

eternal oxide
#

definately no

#

this is what the PDC is for

#

PDC adds nbt tags, and its a built in API

urban elbow
#

Hi guys, if you are looking for a developer, i'm here 😉

#

DM me for more

quaint mantle
#

How to make entity npc? (I already made EntityPlayer npc, but I don't know how to make entity npc)

marble granite
#

can i check if playerA is in render distance of playerB, and have events based on entering / leaving?

#

im okay with using NMS, since i have not seen any spigot methods for this

#

or is that not possible

hybrid spoke
#

lookup Location#distance or Entity#getNearbyEntities and create your own custom event for it

marble granite
#

👍

#

i can do that

echo basalt
#

You can't really do crazy edits on existing NBT tags

eternal oxide
#

His use case did not require "crazy edits"

echo basalt
#

I didn't really read his code, just telling you that NBT APIs have extra features that PDC's don't

#

It isn't always a replacement

#

In this specific case, sure

woeful crown
quaint mantle
#

e

eternal oxide
#

It seems you'd be better off having a whitelist instead of a blacklist

woeful crown
#

there are hundreds of blocks in minecraft, so it's the same either way in this case. I actually did want a whitelist, but a guy we aren't working with any longer started it out with a blacklist for some reason haha

coral sparrow
#

Hello, does anyone know how to get the /command <args> <-- from a command

dense kestrel
#

@coral sparrow

@Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        String arg1 = args[0];
        String arg2 = args[1];
        String arg3 = args[2];
    }
dense kestrel
#

np

quaint mantle
#

Anyone know how to use a good text to speech api which doesn’t sound like a robot

#

Tag me

marble granite
#

does ChunkLoadEvent get called everytime a player loads a chunk, or everytime the server loads a chunk?

#

like, a player loads a chunk already loaded for another player, does the event still get called?

eternal oxide
#

server load

marble granite
#

even more NMS

#

great lol

#

anyway, thank you

wet breach
#

The event gets thrown for chunks that need to load, not for chunks that are already loaded if that helps clarify anything 😉

outer sorrel
#

if I use a PlayerEvent and use instanceof so i can check for specific events (PlayerJoinEvent or PlayerMoveEvent) in one method can i get like do setJoinMessage somehow?

ivory sleet
#

Won’t work

#

PlayerEvent doesn’t have a HandlerList thus cannot be listened on

outer sorrel
#

ok

ivory sleet
#

Then it’s also abstract needless to say

#

I think

#

Or smtng

outer sorrel
#

im just trying to not have multiple events with the exact same code

ivory sleet
#

d;PlayerEvent

wet breach
#

Most of the generic events are just simply there for the API and not something to be used most of the time

ivory sleet
eternal oxide
#

have a handler method. Like you can pass teh teleport event through teh exact same move event code

wet breach
#

And you beat me to it

ivory sleet
#

🥲

wet breach
#

yeah you can create your own events which is probably what you are wanting so you can take in whatever events without having to have multiple event listeners for the same thing 😉

#

Then you would just listen for your own events instead

topaz atlas
#

How do you edit a jar file in spigot?

#

Not create

#

edit

eternal oxide
#

You don't

wet breach
#

open it up like a zip file

topaz atlas
wet breach
#

however, depends what you want to edit in said jar

eternal oxide
#

Its all compiled code. Without a decompiler you can do nothing meaningful with it

wet breach
#

I meant, if you are wanting to edit say like the plugin.yml opening the jar is fine

topaz atlas
#

I just need to open it and change some things

topaz atlas
#

Can I upload that?

eternal oxide
#

upload?

wet breach
#

decompiling someone elses jar to use in yours without express permission is not ok

topaz atlas
#

I will not publish it

#

it will not work in my server

#

I have a specific use case

eternal oxide
#

We can;t comment unless you are more specific

topaz atlas
#

Well I could publish an update. I am using Multiverse-NetherPortals which does not teleport you to a specific portal when you go In then go back out again. Like randomised

#

If it makes you feel better I will make a push request

#

It does not matter as long as I can get the files

#

so I can test a solution

#

Anyways after I decompile the jar file then can I folder inside the decompiled files to the jar file. Basically add a existing folder to the jar file

ivory sleet
#

Sounds like an xy problem in a sense

topaz atlas
#

with all the java files inside

marble granite
#

hmm, if i want to access Chunk, it only gives me 2 options. what do i have to do to be able to listen to that?

topaz atlas
#

All I want to do is fix it for my server

#

Will I be able to edit It on eclipse though?
@quaint mantle

hollow canopy
#

what should I use for all color codes?

#

I mean every color will work with the text

#

I am using getLore.contain()

marble granite
#

oh

#

then what am i supposed to do? listen for taht event, how though?

topaz atlas
#

Wait so can I edit the compiled jar file on eclipes?

marble granite
#

ahh

#

just a normal event lol?

#

dis

#

oh

eternal oxide
#

just check distance between players

marble granite
#

i need the render distance of the player for that

#

i fucking hate nms

#

but, ill do that lol

eternal oxide
#

There would be no noticable performance impact if you only check when a player moves between chunks

marble granite
#

ooh

#

ill try both options

#

but like

#

if there's lets say 50 players online

#

join

eternal oxide
#

He's only looking for when a player moves in/out of view range

marble granite
#

^

wet breach
# topaz atlas Wait so can I edit the compiled jar file on eclipes?

source code for multiverse stuff is available on github. Yes you can go the route of decompiling, but I mean why do something the super hard way, when you can just do it the easy way? Clone the repo on github to your computer, pull the project into whatever editor you like, make your changes and then compile it.

marble granite
#

?

eternal oxide
eternal oxide
# marble granite ?

Basically from what I've seen you ask you are looking to detect when a player moves into view range of another.

marble granite
#

yes

#

then make them visible

eternal oxide
#

Not such a simple task as you can;t tell the players client view range.

crude loom
#

Hey, I'm trying to debug my plugin with eclipse on a server I opened on my pc and it says:
Failed to connect to remove VM. Connection refused.
Any idea on how to fix this?

eternal oxide
#

You can base it on teh servers view range setting

#

if a client chooses to set a lower range, they will be at a disadvantage is all

marble granite
eternal oxide
#

You should not really be using packets at all for this

quaint mantle
#

I keep getting a "Null" error on "pchx" even though in the yml its set to '1'

int pchx = 0;
try {
    BufferedReader is = new BufferedReader(new FileReader("./plugins/Data/UserData/"+user+".yml"));
    Properties props = new Properties();
    props.load(is);
    is.close();
    pchx = Integer.parseInt(props.getProperty("Pets.haspet"));
  } catch (IOException e) {
    e.printStackTrace();
}
``` (The reason its set to a specific folder set is cause multiple plugins use it), but this is the only one that wants to push "Null", what would be causing this, I checked to make sure its valid yml and everything else is working reading the yml but this
marble granite
#

i see

eternal oxide
marble granite
#

i dont get it, do i just put all the players in the same team? and then what? does it make the players visible automatic?

#

(i havent used teams yet, sorry for not knowing much about it)

eternal oxide
#

No you put each player in his own team

marble granite
#

isnt this too resource intensive?

eternal oxide
#

Its quite simple. Detect when a player moves to a different chunk, then check distance to other players. If in range showHidden.

#

No its not too resource intensive

#

you use distanceSquared so you are not square rooting every calculation and it very light

marble granite
#

yea, i only now realised you understood me wrong lol

#

dw

eternal oxide
#

That doesn;t sound like what he was asking

quaint mantle
#

Cause each player has their own custom yml file, plus like I said, this method works for me, but for some odd reason this is the only instance out of all of them that does not want to work and push a null

marble granite
#

i want the player removed from the tablist, but that also removes them from the client

eternal oxide
#

Why do you want them removed from tablist?

marble granite
#

@eternal oxide

eternal oxide
marble granite
#

LOL???

#

my msgs are getting deleted lol

#

tab

#

custom

#

custom tab

#

not anymore lol

eternal oxide
#

why do you want them removed from the tab list?

eternal oxide
#

that doesn;t answer my question

marble granite
#

i want them removed to have a clean workspace

quaint mantle
#

whats the difference between toLowerCase() and toLowerCase(Locale.ROOT)

eternal oxide
marble granite
#

i want to make something like this

#

but, i can only have 3 rows

eternal oxide
#

"Work easier"? You need to explain WHY you don;t want anyone in teh tab list. It seems pointless and a lot of work for no end result

quaint mantle
#

literally what I sent is everything except for the after:

if (pchx == 1) {
//run continued
} else {
//throw error to admins
}
ripe marlin
wet breach
quaint mantle
#

oh okay thank you

eternal oxide
quaint mantle
eternal oxide
#

so hide everyone from everyone else

marble granite
#

i want no one in the tab, so i can fill it in myself. more control

wet breach
#

it can depending on the language being used that you are lower casing @quaint mantle

eternal oxide
#

Ok, you seem to be wanting to do a pointless task

marble granite
eternal oxide
#

Explain better because what you are askign right now has no purpose

marble granite
#

okay

eternal oxide
#

if you use hidePlayer they will only show up when visible and in range

wet breach
#

I think they just want to do what most other servers do @eternal oxide and that is use the tablist to advertise stuff other then just the players lol

eternal oxide
#

so if everyone is hidden you woudl see only yourself in the tablist

marble granite
#

so, we will have 3 categories: "global": all players in that server, "party" people in party, "guild" people in guild. all 3 rows are a different thing

#

does that explain it?

#

basically a ordered tablist

wet breach
#

But, sounds like what you are wanting and would work better is scoreboards

eternal oxide
#

ok, but yes, you are describing a scoreboard

marble granite
#

no

eternal oxide
#

What he is describing is an empty tab list he can put his own data into. A Scoreboard

marble granite
#

when you press tab

#

there's a player list

wet breach
#

Yes, but you do know that list isn't expandable? it only shows so many things lol

marble granite
#

oh shit sorry that wasnt my intention

wet breach
#

@quaint mantle nms isn't needed, but I would agree it is the most reliable way with messing with the tablist

marble granite
#

yea

#

sorry

#

os, i create a packet listener for chunkloadpacket (whatever its name may be) and work on that?

eternal oxide
#

I stopped once I realized you wanted to use the tab list as something its not designed for. 😦

marble granite
#

np

#

yo @quaint mantle i didnt read your full message, and i apologise. i am doing what you told me to rn. thank you for helping me

quaint mantle
#

Can anyone share me a tutorial on how to use the APIs of other plugins?

eternal oxide
quaint mantle
#

Ah

#

void addTokens(OfflinePlayer p, long amount); this for example

wet breach
#

void means it doesn't return anything, and the method takes in an offlineplayer object and a long is just a number object like an int, just can hold more numbers. Should learn some java before diving into a plugins API

quaint mantle
#

ah ok

#

Ok so I have this thing here

ArenaConfig.get().getConfigurationSection(player.getWorld().getName()).set("playerLocation.location" + index, player.getLocation());```
and this thing to be able to use it 
```java
ArenaManager.setPlayerSpawn(player, ArenaConfig.get().getConfigurationSection(player.getWorld().getName()).getKeys(false). size());```
There are no errors at all but it only seems to do 2 locations only, nothing more. When there are 2 locations, it just changes the last one when the command is executed
#

index is the int number, so if location1 exists, it'll do location2

eternal oxide
#

why not just use a list

#

Your issue is probably you need to get("playerLocation").getKeys(false).size()

#

as your key size would always be 1

quaint mantle
eternal oxide
#
ArenaManager.setPlayerSpawn(player, ArenaConfig.get().getConfigurationSection(player.getWorld().getName() + ".playerLocation").getKeys(false). size());```
#

your issue is you are getting the world key but you have a nested map under it.

wet breach
#

"playerLocation.location" + index issue is at this line right here

eternal oxide
#

either get rid of playerLocation. or read it correctly to get the children

wet breach
#

change it to "playerLocation.location." + index notice I added a . or do what ElgarL said.

#

just depends on your use case which is better

#

Most of the time, you would want it as a list

quaint mantle
#

It ends up like this which looks fine but it won't add new locations, it only replaces the last one with a new one

map1:
  playerLocation:
    '0':
      ==: org.bukkit.Location
      world: map1
      x: -55.0
      y: 149.0
      z: 93.0
      pitch: 0.0
      yaw: 0.0
    '1':
      ==: org.bukkit.Location
      world: map1
      x: -63.73502188532504
      y: 149.0
      z: 103.54363610558642
      pitch: 0.0
      yaw: 0.0```
eternal oxide
#

^ thats going to skip 1

dusk flicker
#

Do I see spoon-feeding

quaint mantle
wet breach
#

ElgarL just basically told you

eternal oxide
#

we gave you everything you need to fix it

severe folio
#

To prevent constant use of reflection, would it be a good idea to cache player connections so that I don't have to fetch it via reflection every time?

wet breach
#

your code is going to skip the first index the way you have it

#

hence only getting the second one

eternal oxide
#

far simpler

quaint mantle
#

Hey spigot! How can I make multiple NMS entity extends class? for example, I want use EntityZombie, EntityChicken, EntityArmorStand in same class. {For your information, nms entity extends class looks like : ```public class EntityNPC extends Entity(Type) {

public EntityNPC(Location location){
    super(EntityType.(Type),((CraftWorld)location.getWorld()).getHandle());
    this.setPosition(location.getX(),location.getY(),location.getZ());
    }
    
    @Override
    public void initPathfinder() {
    
    }

}

#

I'd assume you'd just extend Entity without specifying the type

wet breach
#

one of these days, I will remake that plugin XD

#

clean it up etc lol

quaint mantle