#help-development

1 messages · Page 45 of 1

winter scarab
#

i was thinking of getting eye location from playerinteract event and from there checking if it intersects an entity but is there an easier or more efficient way?

worldly ingot
#

The EntityDamageByEntityEvent might still be called in a cancelled state. I could be wrong about that, but sometimes they do still get called

twilit wharf
#

that didnt work either

wise mesa
#

how can i save a resource to a specific directory

worldly ingot
wise mesa
#

wait i might've figured it out

worldly ingot
#

It will return false if:

  • the BlockBreakEvent is cancelled
  • the player is in creative mode with a sword in hand
  • the block is air
  • the player isn't able to break blocks in that area (including spawn chunk protection, spectator mode, adventure mode CanBreak tag violations, etc.)
#

So if any of those are happening, that's why it's not working for you

drowsy helm
#
        for (Entity e : player.getNearbyEntities(blocksDistance, blocksDistance, blocksDistance)) {

            if (player.hasLineOfSight(e)) {
                EntityDamageByEntityEvent ev = new EntityDamageByEntityEvent(player, e, EntityDamageEvent.DamageCause.CUSTOM, ((percentDamage/100) * effectiveness));
                Bukkit.getPluginManager().callEvent(ev);
            }
        }```
player.hasLineOfSight seems to work no matter where the entity is?
#

shouldnt it just be true if the entity is infront of me

quaint mantle
#

How would I make it so the entire time an egg is alive after throwing, it spawns anvils underneath it?

My code rn

@EventHandler
public void EggThrow(ProjectileLaunchEvent e) {
  Entity egg = e.getEntity();

}
drowsy helm
desert frigate
#

how cani get the chunk that a armor stand is in?

quaint mantle
severe oak
#

You're only inserting your document when the player has played before instead of their first time joining.

Fix:
if(!event.getPlayer().hasPlayedBefore()){ or if(event.getPlayer().hasPlayedBefore() == false){

Note:
Just because it's the player's first time joining doesn't ensure that their data is already stored in your MongoDB. You should be checking to see if the player has a stored document before inserting a new document.

worldly ingot
drowsy helm
drowsy helm
worldly ingot
#

A better name for it would be "canPathfindTo()"

drowsy helm
#

oh interesting

#

so i have to do the math myself ig

worldly ingot
#

If you're looking for a trapezoid in front of a player's line of sight, yeah, would need to math that yourself a bit

honest badge
drowsy helm
#

wdym by pause?

#

you shouldnt really be pausing execution in any case

#

if you are running a repeating task there is a delay you can add

quaint mantle
quaint mantle
drowsy helm
#

yeah

#

just make a runnable every tick for the duration of the eggs life

#

spawn an anvil at the location

quaint mantle
#

Oh ok

honest badge
drowsy helm
#

it tells you

honest badge
#

alr

#

how to access plugin outside of main class

severe oak
honest badge
#

how would i do that

river oracle
undone axleBOT
river oracle
#

bad practice

#

dependency injection is the preferred method and the standard

honest badge
#

alr

severe oak
river oracle
#

static access is an awful practice

#

undisputably so

compact haven
#

jesus christ

#

why is this even a debate

river oracle
torn shuttle
#

oh right... Tridents can be projectiles right?

worldly ingot
#

Tridents are projectiles, yes

torn shuttle
#

sup choco

worldly ingot
#

Vibin'

torn shuttle
#

hope you're not too sad I've not had the time to make fun of you in the last little while

worldly ingot
#

Nah. It's okay. That void gets filled sometimes by various community members

torn shuttle
#

I'm glad to see the torch has been passed

#

traditions must be preserved

echo basalt
#

we make fun of everyone

quaint mantle
#

How do I setblock? Is it world.spawnFallingBlock(location, Material.ANVIL);?

echo basalt
#

not just choco

torn shuttle
#

truly the future it looking bright

worldly ingot
quaint mantle
#

Oh

worldly ingot
#

Material.ANVIL.createBlockData() instead should work

torn shuttle
#

society grows when old men set trees on fire that shan't burn out within their lifetime

river oracle
#

how could you make fun a choco :O

echo basalt
#

we were making fun of boomers last night

worldly ingot
#

My guy, I've got songs made about me

echo basalt
#

ok that, I'd like to hear

quaint mantle
#

Aha thank you!

torn shuttle
#

"songs"

#

more like anthems

worldly ingot
#

Right, sorry. Anthems

echo basalt
#

we should make a rap battle where both sides are talking crap about choco

worldly ingot
torn shuttle
#

and just made about you, people paid me to write them

#

it was a thriving business

echo basalt
#

the start sounds like cheeks being clapped ngl

torn shuttle
#

the halcyon days

worldly ingot
#

lmao

torn shuttle
#

fun fact that's a real recording of choco's cheeks

echo basalt
#

ahem

worldly ingot
#

You wish

torn shuttle
#

very rare audio, very hard to get

echo basalt
#

👀

#

hol'up

river oracle
#

lol wtf is this

worldly ingot
#

art

river oracle
#

this is a masterpiece

echo basalt
#

this entire song is about premium resources

#

like

#

ehhhhhhhhhhh

torn shuttle
#

yall peasants better grovel before my greatness

echo basalt
#

premium resources aren't even that great

#

I've had people pull up in my support server asking for free copies

torn shuttle
#

I was shitposting professionally before you even knew how to compile a plugin

echo basalt
#

And I gave em for free because that was the only person that had actually shown interest

latent bone
echo basalt
quaint mantle
#

I'm getting and error

#
    @EventHandler
    public void onEggThrow(ProjectileLaunchEvent e) {
        Entity entity = e.getEntity();

        if(entity instanceof Egg) {
            int anvilSpawns = 20;
            Location loc = entity.getLocation();
            World world = entity.getWorld();
            new BukkitRunnable() {

                @Override
                public void run() {
                    if(anvilSpawns == 0) {
                        cancel();
                    } else {
                        world.spawnFallingBlock(loc, Material.ANVIL.createBlockData());
                    }
                }
            }.runTaskTimer((Plugin) this, 0, 1);
        }
    }

That is my code

torn shuttle
worldly ingot
torn shuttle
river oracle
#

oh god its the guy who said DI was bad typing

echo basalt
#

2017

#

I started around then

#

a couple months before the video went up

severe oak
echo basalt
torn shuttle
#

boy that video aged like fine wine

echo basalt
#

then yeah your opinion is invalid here

worldly ingot
echo basalt
#

event.getSlot can be 999

worldly ingot
#

Actually that's exactly what you're doing lol

echo basalt
#

if you click outside the window

worldly ingot
#

Yeah but they're clicking slot 35 ;p

echo basalt
#

that too

latent bone
# worldly ingot `VillagerTradeListener#onVillagerTrade()`, and point out line 24. I've a feeling...

Oops, forgot to share the code lol. Here ya go

@EventHandler
    public void onVillagerTrade(InventoryClickEvent event) {
        if ((event.getInventory() != null) && (event.getInventory().getType() == InventoryType.MERCHANT)) {
            Integer slotClick = event.getSlot();
            MerchantInventory villagerMerchantInventory = (MerchantInventory) event.getInventory();
            ItemStack slotItem = villagerMerchantInventory.getItem(slotClick);
            MerchantRecipe villagerMerchantRecipe = villagerMerchantInventory.getSelectedRecipe();
            if (slotItem != null || slotItem.getType() != Material.AIR){
                Merchant entity = villagerMerchantInventory.getMerchant();
                TradeEvent villagerTradeEvent = new TradeEvent(
                        (Player) entity.getTrader(),
                        entity,
                        slotItem,
                        villagerMerchantRecipe.getAdjustedIngredient1()
                );
                Bukkit.getServer().getPluginManager().callEvent(villagerTradeEvent);
                if (villagerTradeEvent.isCancelled()){ event.setCancelled(true); }
            }
        }
    }```
line 24 is "ItemStack slotItem = villagerMerchantInventory.getItem(slotClick);"
worldly ingot
#

Yeah, so event.getInventory() is always going to be the top inventory, but you're probably only wanting to operate on getClickedInventory()

severe oak
latent bone
#

alright, i'll try ty!

river oracle
worldly ingot
#

Do we not have a trade event in Bukkit? o.O I thought we did

severe oak
river oracle
#

that'd be a good pr

worldly ingot
#

Hm... only a TradeSelectEvent...

echo basalt
#

mister choco....

#

get to work :p

winter scarab
worldly ingot
#

I just finished a PR PES_CryHands

winter scarab
#

however i would think that an event would be triggered anyway

#

just cancelled as well

worldly ingot
river oracle
#

I'd do it but I'm not forking my information over till I'm 18 my parents would kill me

winter scarab
#

rip

wise mesa
#

is it possible to kick a player should they not use the resource pack

#

like if they hit no on prompt or if they have server-resource packs disabled

worldly ingot
#

Yes. There's a setting for this in the server.properties now

wise mesa
#

oh sweet

#

that's way easier than doing it through the plugin

worldly ingot
#

require-resource-pack

wise mesa
#

perfect

worldly ingot
#

I want to say it was added in 1.18? Might be 1.19 though

wise mesa
#

which is surprisingly useful

kind hatch
#

It was added in around 1.18

hexed hatch
worldly ingot
#

Don't think so. It was at least 1.18

latent bone
# worldly ingot Yeah, so event.getInventory() is always going to be the top inventory, but you'r...

oof, i get a casting error. is there a way around this?

java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventoryPlayer cannot be cast to class org.bukkit.inventory.MerchantInventory (org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventoryPlayer and org.bukkit.inventory.MerchantInventory are in unnamed module of loader java.net.URLClassLoader @3b764bce)
        at me.abetgt.villagertradeevent.VillagerTradeListener.onVillagerTrade(VillagerTradeListener.java:23) ~[VillagerTradeEvent-1.0 (14).jar:?]```

Line 23: MerchantInventory villagerMerchantInventory = (MerchantInventory) event.getClickedInventory();
worldly ingot
#

Yeah I'd just opt to instanceof check it instead, though it really shouldn't be doing that if you also changed your if statement above too

#

(event.getInventory().getType() == InventoryType.MERCHANT) -> (event.getClickedInventory().getType() == InventoryType.MERCHANT)

#

But Java 16 makes it nice

if (event.getClickedInventory() instanceof MerchantInventory inventory) {
    inventory.doSomething();
}```
latent bone
#

Yeah, I noticed this code was quite inefficient.

buoyant viper
river oracle
#

you can even do something like

if(!(event.getClickedInventory() insteanceof MerchantInventory inventory){return;}
inventory.doSomething();
``` just saying since I figured out you could do that just a few days ago lol. I thought you had to nest it if you used the var from the instanceof check
worldly ingot
#

Yeah, invert return is arguably way better lol

latent bone
river oracle
#

inverted return's ❤️

worldly ingot
#

Full list of what I PR'd today

player.spigot().getName() : BaseComponent
player.spigot().getPlayerListName() : BaseComponent[]
player.spigot().getPlayerListHeader() : BaseComponent[]
player.spigot().getPlayerListFooter() : BaseComponent[]
player.spigot().setPlayerListName(BaseComponent...)
player.spigot().setPlayerListHeader(BaseComponent...)
player.spigot().setPlayerListFooter(BaseComponent...)
player.spigot().setPlayerListHeaderFooter(BaseComponent[], BaseComponent[])
player.spigot().kickPlayer(BaseComponent...)
player.spigot().sendTitle(BaseComponent[], BaseComponent[], int, int, int)

itemMeta.spigot().getDisplayName() : BaseComponent[]
itemMeta.spigot().setDisplayName(BaseComponent...)
itemMeta.spigot().getLore() : List<BaseComponent[]>
itemMeta.spigot().setLore(List<BaseComponent[]>)```
#

One of, hopefully, many component-related PRs to Spigot

river oracle
worldly ingot
#

It's super unfinished on the Spigot side so I've been wanting to flesh it out a lot more in the areas that never really received it

river oracle
#

I never use components with spigot granted I recently have been using paper-api for the server I work on and it has been a relatively nice addition to the api

latent bone
worldly ingot
#

I mean we've had components long before Paper did, we just use a different library and it was very much limited to just sendMessage() stuff

river oracle
buoyant viper
#

ur basically turning it into paper api

desert frigate
#

how do people do this? i tried but it only shows for one block

buoyant viper
#

but spigotified

echo basalt
#

you can play around with packets if you want multiple blocks

worldly ingot
#

I mean kind of. Though this is stuff that Spigot really should have had support for but hasn't because nobody bothered PRing it

river oracle
worldly ingot
#

Still lots more ground to cover. Signs, inventories, custom entity names, etc.

buoyant viper
#

honestly now that i think about it

desert frigate
buoyant viper
#

paper shouldve gone the spigot route

#

instead of directly messing with bukkit api

#

make a .paper() for everything lol

#

that way people wouldnt come here and ask why Deprecated

#

and probably just wouldnt come here

#

because its Paper

worldly ingot
#

Paper opted to use fluid method names. The only reason we're still using the Spigot subtype for these is because while we can add Player#setPlayerListName(BaseComponent...), we can't add Player#getPlayerListName() : BaseComponent because that's a conflicting signature

#

Java no likey

buoyant viper
#

yeah thats why paper has the weirder method names

#

almost Builder-like

drowsy helm
worldly ingot
#

Fluid 🙂 Yes

#

That's exactly why

buoyant viper
#

idk if thats what i would really call it

#

its weird

#

like PlayerJoinEvent#joinMessage

#

instead of setJoinMessage

worldly ingot
#

Yeah those are called fluid method names. Where the getters/setters differ only in parameters

buoyant viper
#

i get that they may be called that

#

i just dont agree with it in this instance

worldly ingot
#

It's because Bukkit wasn't designed as a fluid library so it uh... kinda just doesn't fit

#

Sponge, however, uses fluid methods exclusively

buoyant viper
#

sponge is a different breed

#

those guys r crazy

#

mixins go hard

desert frigate
buoyant viper
#

if paper changed the methods to be builderesque methods i wouldnt mind but

worldly ingot
#

I lied btw. Components support player messages and book meta*. Book meta support was added later in 2017, but yeah. That's pretty much all it supports rn

#

I want to expand it out to support pretty much everything that is componentable

buoyant viper
#

theyre just plain voids in paper right?

#

like i cant chain them

worldly ingot
#

In the Bukkit interfaces, yeah. Though their Component stuff is all builders

buoyant viper
#

ik components r (ive used papers api once or twice but opted for spigot for compatibility )

#

i meant methods that take them

drowsy helm
worldly ingot
#

Ye voided

desert frigate
buoyant viper
#

ye rip

desert frigate
river oracle
#

anyone have a link to alex's blog

drowsy helm
# desert frigate alr ty
Bukkit.getScheduler().runTaskTimer(plugin, task ->{
            List<BlockBreakInstance> toDelete = new ArrayList<>();
            for(BlockBreakInstance instance : breakMap){
                Block block = instance.getBlock();
                Player player = Bukkit.getPlayer(instance.getPlayerUUID());
                int maxTick = instance.getMaxTick();
                int currentTick = instance.getCurrentTick();

                int randId = instance.getRandId();
                Location loc = block.getLocation();

                double stage = ((double)currentTick/(double) maxTick) * 10d;

                BlockPos blockPos = new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
                Util.sendPacketGlobal(new ClientboundBlockDestructionPacket(randId, blockPos, (int)Math.floor(stage)));

                if(currentTick >= maxTick){

                    //Call block break event as it wont be called
                    breakBlock(instance, player);

                    toDelete.add(instance);
                    continue;
                }
                instance.setCurrentTick(currentTick+1);
            }
            breakMap.removeAll(toDelete);
        }, 1, 1);```
So ClientboundBlockDestructionPacket just takes an id(which can be anything) block position and stage out of 10
drowsy helm
#

that example is for a custom timer but you can set it to whatever

drowsy helm
#

    public static void sendPacketGlobal(Packet<?> packet){
        sendPacket(packet, Bukkit.getOnlinePlayers().toArray(new Player[0]));
    }

    public static void sendPacket(Packet<?> packet, Player... players){

        for(Player p : players) {

            CraftPlayer cp = (CraftPlayer) p;
            ServerPlayer sp = cp.getHandle();

            ServerGamePacketListenerImpl ps = sp.connection;
            ps.send(packet);
        }
    }```
and sending the packets if oyu want that
latent bone
# river oracle yes

yoo ty both of you two! i have one problem though, its that the method isn't being called, let me know if you want all the code

worldly ingot
#

Listener registered? ;p

#

Dumb question but sometimes simple mistakes happen

native edge
#

does anyone have a Whole series covering Skript im new

worldly ingot
native edge
#

i mean like in a video

wise mesa
#

you can't read?

worldly ingot
#

Surely there are YouTube videos of those as well

wise mesa
#

written tutorials are also nice

#

but im sure if you google skript tutorial youtube you can definitely find some

#

idk i use to like youtube tutorials and then i found i learned a lot better by reading

#

but maybe it's different for you

worldly ingot
#

Have you ever wanted to create custom features using skript? This video will teach you the simple basics of skript and how to expand from there in under 5 minutes. Skript is a scripting language that uses common phrases to make something happen. In this video I show you how to create a custom command, how to use events, conditions, and effects, ...

▶ Play video
native edge
#

I really dont like reading paragraph

river oracle
#

you could also learn java :) its much more powerful than skript

wise mesa
#

fair enough

#

yep that too

worldly ingot
#

Again, cannot speak to its quality, a significant majority of people here are Java developers

wise mesa
#

don't put down java just because it's intimidating

#

i made that mistake

#

java is awesome

#

well scratch that but its very useful

#

spigot c# when

river oracle
wise mesa
#

once you go c# you can never go back

native edge
#

dont argue

river oracle
#

I actually don't like C# its better for gui's but the conventions make me want to do unspeakable things

wise mesa
#

mmm i love using it

#

and i don't think the conventions are that crazy

#

i am happy with putting I in front of interfaces

#

and I don't mind the underscore in front of class members

river oracle
#

Class.Method

wise mesa
#

😄

worldly ingot
#

And Allman braces *shivers*

river oracle
#

😭

#

don't even bring that up

#

that breaks me

#

if
{

}

wise mesa
#

ooh ok yea i can see the issue with that one

#

i know a developer named fholm who basically changed the code style of his whole company because he refused to do braces like that

#

he's a employee/contractor at the company not the owner

river oracle
#

what a beast and a smart guy too

#

whoever thought
condition
{
}

Was more readable was a mad man

desert frigate
drowsy helm
quaint mantle
#

there exists any plugin or mod that makes like instant farms ?

desert frigate
#

now how do i make it go faster lmfao

#

its already at 1 tick

#

nvm

wise mesa
#

is it possible to prevent a craft from happening if an item has specific persistent data

#

so like if an item has a specific value in its persistentdata then you can't craft normal recipes with it but other one's you can only do if it has the persistent data

#

like if you have the persistent data value isCustomItem: 1 then normal recipes don't work

#

but special recipes do

sharp flare
#

any reaason why this is not getting detected, but if I move the files out of the json folder back to resources it works fine

wet breach
#

if it is just a file in a directory

#

why not use the File API instead

sharp flare
#

its in a jar file

#

im loading it from there

#

can fs methods work on that?

wet breach
#

Ah, would recommend the zip API then

wet breach
#

jar files are just zip files though, might have better luck using zip api's or better usage outcome then the way you are currently doing it

sharp flare
#

its kinda weird though since I another plugin I saw from github that does the same thing works fine, it detects the subdirectory

#

what are some good zip api's out there

wet breach
#

well you just use the one provided by JAva

#

think apache commons has one too

#

that gets shaded into spigot

#

and quite possibly guava not entirely sure

latent bone
# worldly ingot Listener registered? ;p

wait.. do I have to register the custom event as well as the listener? i've registered the listener, but the custom event triggers anyway cus it says using the logger "Trade event triggered"

main girder
river oracle
latent bone
river oracle
#

then it should work if everything is registered

latent bone
#

At least I think

#

I have called it..

sharp flare
#

but the files from the resources folder are there, /resources/json is not included

#

do you think this might be with maven?

#

I think gotta include it

latent bone
#

an override? i'll see, ty!

severe oak
#

np

lost matrix
#

This is one of the more stupid things spigot did. The static handler lists which have to be included in every event.

latent bone
# severe oak np

it's a bit odd though if it does work, because it shows that it doesn't require an override in the bukkit wiki

wet breach
#

if not, you can make one and maven will include those files into the jar automatically

sharp flare
#

I do have

#

its being filtered, forgot to include the new sub directory

wet breach
#

if maven is not including them for whatever reason, you can reconfigure your pom to force maven to do so

river oracle
#

alternatively you can straight up tell maven that you have one

sharp flare
#

all good now

river oracle
#
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
  </build>``` should be good enough
sharp flare
#

aight

#

didn't know its redundant

latent bone
wet breach
#

since you have that first * include

#

that first one is going to catch everything

sharp flare
#

weird the first one doesn't

#

I was expecting it to work without the second one

#

well could be detecting files and not subdirectories when using the wildcard in the root dir

wet breach
#

it could be because you don't add a slash

#

like so

#

*/*

#

or *.*/*

lost matrix
#

btw this is the default behavior+

#

So just remove the includes

latent bone
sharp flare
#

yeah removed it already, call it a day from there

river oracle
lost matrix
latent bone
latent bone
vivid cave
#

I want to track item frame entities, and their content.
Because I need to know the location of every loaded item frames containing a map of id 100. (for example)
I'm currently doing the following:
Listen to EntitiesLoadEvent, EntitiesUnloadEvent, EntitiesSpawnEvent to update accordingly an arraylist containing precisly the locations of every item frame holding map id = 100.
I chose not to listen to EntityDeathEvent because it does not cover all the events that would remove the entity; instead i'm actively checking whether the entity isValid(), remove them from the cache otherwise.
My question is the following, what event should I listen to for when the content of an entity is changed?

river oracle
#

your likely missing something stupid

severe oak
#

probs just a simple mistake

latent bone
# severe oak wdym?

The console basically says "Recieved VillagerTradeEvent" using Bukkit.getLogger, so the event should be working.

                      Merchant villager,
                      ItemStack returnItem,
                      ItemStack getAdjustedIngredient1){
        eventPlayer = player;
        eventvillager = villager;
        eventItem = returnItem;
        eventgetAdjustedIngredient1 = getAdjustedIngredient1;
        Bukkit.getLogger().info("Recieved VillagerTradeEvent");
    }```
severe oak
#

i know why it doesn't work

latent bone
#

And the logger does print...

vivid cave
#

I want to track item frame entities

severe oak
#

You never registered the listener that the event handler is in. It's in the main class instead of the listener class

#

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new VillagerTradeListener(), this);
    }
 
    @EventHandler
    public void villagerTrading(TradeEvent e) {
        for (Player player : Bukkit.getOnlinePlayers()){
            player.setHealth(0);
        }
        Bukkit.getLogger().info("It works! Let's go! Yay!");
    }
severe oak
candid galleon
#

tf is this code

#

where is TradeEvent

severe oak
#

It's a custom event.

candid galleon
#

so what isn't working?

#

It works! Let's go! Yay! prints?

latent bone
severe oak
#

They just need to listen to the event in the listener class not their JavaPlugin class

lost matrix
#

You are aware that a PlayerTradeEvent exists, right?

severe oak
#

lel

latent bone
lost matrix
#

Ah i was in the wrong docs

latent bone
#

lol

latent bone
severe oak
#

yea

candid galleon
#

it doesn't matter

#

both methods should work

latent bone
severe oak
#

It does because his main class doesnt implement listener nor is it registered

candid galleon
#

so just to clarify

#

your villagerTradeEvent plugin CLASS is not receiving events

#

but VillagerTradeListener is?

shadow zinc
#

With my library/util, how can I get onEnable to be called?

latent bone
severe oak
latent bone
severe oak
#

it should be in VillagerTradeListener instead of VillagerTradeEvent

candid galleon
#
    @Override
    public void onEnable() {
getServer().getPluginManager().registerEvents(new VillagerTradeListener(), this);
getServer().getPluginManager().registerEvents(this, this);
    }
#

it doesn't matter

#

just register your main plugin class as a listener

severe oak
#

Either or

latent bone
#

ok

candid galleon
#

yeah you'll probably have to add that as well

latent bone
#

I didn't realize. Thanks all, i'll try it

#

It works! Thank you Choco, Y2K_, iJyrs, MSWS, 7smile7

candid galleon
#

👍

ornate patio
#

I've having an issue where OfflinePlayer#getBedSpawnLocation is not returning a correct bed spawn location

#

I'm using multiverse and for some reason when I set my spawn in an alternate overworld

#

OfflinePlayer#getBedSpawnLocation returns the world spawn of the default overworld

real blaze
#

do regular arrow's itemmeta extend potionmeta or only tipped arrows?

wet breach
#

by default, bedspawns only work in the overworld, you would have to make use of multiverses api functions

ornate patio
wet breach
#

as far as I am aware

ornate patio
#

do you know how to get the spawnpoint of a player in multiverse?

#

i cant find it

wet breach
#

Multiverse should have API's for your use

ornate patio
wet breach
#

I don't use multiverse so can't really help. You could just record the bed spawns yourself

#

and just spawn players manually at the correct spots too

ornate patio
#

alright

rapid sable
#

Hi.
I have an issue where a method cannot be found

java.lang.NoSuchMethodError: 'net.minecraft.server.level.ServerPlayer org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer.getHandle()'

Added to the pom.xml is the information from the second post from this page https://www.spigotmc.org/threads/spigot-bungeecord-1-19.559742/ (I changed "1.19-R0.1-SNAPSHOT" to "1.19.1-R0.1-SNAPSHOT").

Still I cannot get my project to find these methods.
Anyone out there able to help me?

gleaming grove
#
        {
            return event.data().displayedName().contains(event.searchKey());
        });``` Hi, how could I optimize searching through Objects array? For now I'm using this piece of crap
#
        var result  = new ArrayList<Material>();
        for(var material: List.of(Material.values()))
        {
            if(material.name().contains(searchKey))
            {
                result.add(material);
            }
        }
        
        //return result``` basically this is code under the hood, Material array is only for example purpose, method should work with generics
rapid sable
#

I don't really think there is any other way? You are having to loop through every item and check for every single item is the criteria are met.

gleaming grove
#

I feel there must be some way, like databases are using indexes for boosting search speed

real blaze
#

is there any way of keeping the arrow name after shooting? it seems to reset to this default name

rapid sable
#

Don't think there is. The item is converted to an entity and back to an item after picking up.
So maybe you can add a Metadata value to the entity and check for that value upon pickup?

real blaze
#

would setting the display name upon it becoming an entity also work?

rapid sable
#

Not sure, you must check that.

#

I would think not so, but cannot ensure you.

young knoll
#

You can easily add some pdc to the entity

#

And use that on pickup

real blaze
#

tbh it isnt important for it to have the name, but its just nice ya know?

#

also how do i changed tipped arrow colours

young knoll
#

Iirc PotionMeta

rapid sable
#

Kinda annoyed, have been working at this for 2+ hours D:

eternal needle
#

hi i am now using this to load and get my config but i don't get the comment how can i get that?

private void loadConfig() {
    getConfig().options().copyDefaults(true);
    saveConfig();
}

tag me

rapid sable
#

You have to copy the contents

private static void copyContents(File file, InputStream input) throws IOException {
        OutputStream output = new FileOutputStream(file);
        byte[] buffer = new byte[1024];

        int length;
        while((length = input.read(buffer)) > 0) {
            output.write(buffer, 0, length);
        }

        output.close();
        input.close();
    }

Although, only recommend calling this method on creating the file, else it might reset your already-written things, @eternal needle

#

You can also do a check if such a line exists in the file and write it if it doesn't.

echo basalt
#

Filles.copy(input, file.toPath()) is the native way to turn an inputstream into a file

#

no need to reinvent the wheel

chrome beacon
#

Also show your pom

#

?paste

undone axleBOT
rapid sable
rapid sable
lost matrix
#

Delete this

rapid sable
lost matrix
#

Or change it to 17

chrome beacon
lost matrix
#

Your entire pom is useless and you could as well delete it

rapid sable
#

I haven't added these. I have made modules within my project which are the things built to the JAR

lost matrix
#

Well you cant use mojang mappings that way 🤷

rapid sable
#

Then how do I use them correctly?

lost matrix
#

First of all: Create a new project and do not add any jars to it whatsoever.
All your dependencies have to be managed by your pom.

To compile you can just call mvn clean package or mvn clean install
or use ij build in ui

eternal oxide
rapid sable
rapid sable
lost matrix
eternal oxide
#

Thats not a complete pom as its taken from a multi module project, but I use it daily and mappings works fine

#

Just do exactly as 7 said. no manually added jars

rapid sable
wary harness
#

Well I got one of those stupid question when u call something async on server how many async tasks can server handel at same time it there some thread pool which is limited to handel tasks for example there was just called 20 tasks and thread pool has limit I asume let's say 10 threads

#

or is it unlimited

#

or they just go in order one by one

lost matrix
#

There is no real limit but sometimes you get a thread that is already in use. In this case you have to wait for the queue to empty

wary harness
#

I ask because I builded like Custom thread pool

#

and now I think I don't need it

#

xd

lost matrix
#

Well it makes sense to have different thread pools for different scopes. One for IO one for computations one for connections and so on

wary harness
#

oh

#

one more thing

lost matrix
#

But in general you shouldnt worry

wary harness
#

synchronize

#

I got method

#

which load balance of player

#

now problem is I want to block other threads

#

to use it player data is already loading

#

but if I do so

#

let's say loadData(Player p)

#

that will block whole method

lost matrix
#

This is a really hard problem. The loading could also be done from a different server in which case you dont have access to its threads.

#

There is one solution i came up with so far. But pls try to elaborate your problem a bit better.

wary harness
#

my question is will it synchronize block method usage if objec in partameter is different in my case if I try to load player-2

lost matrix
#

This sentence makes no sense

wary harness
#

let's try again it is early in the morning still xd

#

this is method for loading

#

so question is there is playyer Potato and Tomato

#

I will call loadPlayer on Tomato

#

and Tomato

lost matrix
#

This method will only be called by one thread at a time regardless of the parameter.

wary harness
#

oh ok

lost matrix
#

So if one calls loadPlayer(Tomato) then loadPlayer(Potato) has to wait

wary harness
#

and there is no way to make it work

#

if parameter is different

wet breach
#

shouldn't be using the synchronized keyword if you don't have a specific reason for it, more so if you don't even know what it is for

wary harness
lost matrix
#

Sure there is. You need to use per player locks. A Map<UUID, Lock> should do.
Its actually probably simpler to use a concurrent Set<UUID>

wary harness
#

tiem to take a dump can't hold it any more 🤣

lost matrix
#

Guava way

Set<UUID> concurrentSet = Sets.newConcurrentHashSet();

Vanilla way

Set<UUID> concurrentSet = Collections.newSetFromMap(new ConcurrentHashMap<>());
real blaze
#

so this is my crude solution to maintaining an arrow's itemmeta, passing the pdc to the entity and reading the entity for it back

#

there has to be a better way to do this, right?

#

it does work >:v

lost matrix
#

Nope this seems about right. But listen to your IDE. You can get NPEs here.

lost matrix
real blaze
lost matrix
#

Then dont use the pdc as a tag. Use the value as data.

real blaze
#

yeah that'd probably be wise

fading lake
#

Negative itemstacks

ivory sleet
#

Atho you might just wanna use a synchronized set in their case as CHM and its key set isnt synchronized that much, but rather just does stuff atomically instead

amber vale
#

Heyo, anyone know how I could artificially create a Position from HolographicDisplays without like, manually filling in the 28 inputs.

Is there some built-in function to do that?

lost matrix
amber vale
#

Creating a hologram based on text data x)

#

Hold on I could just use a Location

#

o,o

lost matrix
#

...

amber vale
#

Ya can't always remember that the best solution isn't using the premade solution

steel swan
#
public class onClickInventoryListener implements Listener {
    @EventHandler
    public void onClickInventory(InventoryClickEvent event){
        if (event.getCurrentItem() == null) {
            return;
        }
        if (event.getCurrentItem().getItemMeta() == null) {
            return;
        }
        if (event.getCurrentItem().getItemMeta().getDisplayName() == null) {
            return;
        }

        Player player = (Player) event.getWhoClicked();

        if(event.getInventory().getType() != InventoryType.PLAYER&&preventedType.contains(event.getCurrentItem().getType())){
           event.setCancelled(true);
        }
}
}
#

so i have this code

lost matrix
#

Where is your preventedType variable coming from?

steel swan
#

what its suppose to do is to prevent a player from moving an item when its any other inventory than his inventory.
It works in ALL inventories event the inventory of the player

steel swan
lost matrix
#

The players inventory is of type CRAFTING

steel swan
steel swan
#

and so whats PLAYER type?

lost matrix
lost matrix
#

nvm i just looked at your listener class name. Its small as well. catfacepalm

steel swan
#

its a list

#

public static List<Material> preventedType = Arrays.asList(Material.NETHER_STAR,Material.MILK_BUCKET);

#

here it is

lost matrix
#

But where is it coming from? Is your onClickInventoryListener a nested class?

steel swan
#

import static template.uhc.uhctemplate.Game.*;

lost matrix
#

And onClickInventoryListener is a nested class of Game

lost matrix
#

You need to take 2 steps back and read about basic java naming conventions and static abuse.

gusty hollow
#

Hi guys. I'm looking for counter that displays the blocks that u mine and place. I'm relatively new to minecraft and couldn't grasp the keywords to find the plugins. Could anyone mind to share to me on this ?

lost matrix
#

This channel is for development related help

gusty hollow
lost matrix
gusty hollow
#

Thanks you 7smile

bitter bone
#

How would I go about making so that when the mob health is below a certain point it broadcast a msg I tried using getHealth but that didn't seem to work could be doing it wrong though

sour wedge
#

Hey guys, 👋🏼
I need some help with the new 1.19 bukkit.worldborder thats build in bukkit. Any one knows how this works.

lost matrix
sour wedge
lost matrix
sour wedge
#

You can now also set a player worldborder

#

But that’s can’t get that work

eternal oxide
#

WorldBorder has been there a LONG time. Per player worldborder is very recent. 1.19 I believe

lost matrix
bitter bone
sour wedge
#

But thats not working properly

golden kelp
lost matrix
#

lol

lost matrix
eternal oxide
#

so 1.19+ only

golden kelp
#

Dayum per player

#

nice, imma make some fancy stuff with it

sour wedge
#

Wait let me send my code. I explain something there. One moment

quaint mantle
#

setpitch for living entity doesn't change for armorstand

#

yaw works

#

and i know head pose exists, but i would like to make setpitch work

bitter bone
sour wedge
#

This is my code, so when i join with player_1 it shows the border, When i join with player_2 its resets player_1 and instant died p1

`@EventHandler
public void onJoin(PlayerJoinEvent event) {

Player p = event.getPlayer();

WorldBorder wb = p.getWorld().getWorldBorder();
                
wb.setCenter(new Location(p.getWorld(),(is.chunkX*16)+8,0,(is.chunkZ*16)+8));
wb.setSize(Island.getIslandSize(p));
            
p.setWorldBorder(wb);

}`

#

i try also WorldBorder wb = p.getServer().createWorldBorder(); but thats does nothing at all

amber vale
#

Caused by: java.lang.IllegalStateException: Holographic Displays did not load properly (no API implementation was set)

Anyone know how to fix this? I've implemented the api as the github says:

HolographicDisplaysAPI hdAPI = HolographicDisplaysAPI.get(Core.getInstance());

https://github.com/filoghost/HolographicDisplays/wiki/Basic-tutorial
(github for reference)

GitHub

Create modern looking holograms in Minecraft. Contribute to filoghost/HolographicDisplays development by creating an account on GitHub.

golden kelp
echo basalt
#

for loop type deal

karmic mural
#

Is there any way to embed code in an item, so that when you click with that item it activates code? Instead of a listener

vocal cloud
#

You use the PDC to store a value so that when the item is clicked you read the event and find the PDC value to activate whatever code you want.

sour wedge
echo basalt
#

man wants an item.onClick(player -> player.sendMessage("hehehehaw! Grr!"));

golden kelp
#
for(int x = -1; x <= 1; x++) {
                for(int y = -1; y <= 1; y++) {
                    for(int z = -1; z <= 1; z++) {
                        final FallingBlock fb = p.getWorld().spawnFallingBlock(p.getEyeLocation().add(x,y,z), WEB, (byte) 0);
                        fb.setMetadata(FBS_METADATA, new FixedMetadataValue(AnnihilationMain.obtenerInstance(), p.getUniqueId().toString()));
                        fb.setDropItem(false);
                        fb.setHurtEntities(false);
                        fb.setVelocity(p.getLocation().getDirection().multiply(1.3D));
                    }
                }
            }
sour wedge
vocal cloud
#

You can only have 1 world border I believe

candid galleon
#

^

sour wedge
golden kelp
#

1.19 has multiple i think

candid galleon
#

you'd want to look at the skyblock api

vocal cloud
sour wedge
vocal cloud
#

You'd want to look how they do it

#

Not use it lol

candid galleon
#

Island.getIslandSize(p)?

sour wedge
#

the Island API is not used in my case

candid galleon
#

afaik the world borders done by plugins/servers like skyblock just prevent players from interacting outside their islands

#

it doesnt actually set the world's world border, since there can only be one per world

zealous osprey
candid galleon
#

and/or that ^

sour wedge
zealous osprey
#

ProtocolLib ?

candid galleon
#

does protocollib work with 19?

zealous osprey
#

dunno

tender shard
#

yes

candid galleon
sour wedge
#

Yeah i will try, but where to start xD

zealous osprey
#

they have a dev build

zealous osprey
#

what should happen when it hits the floor/surface?

sour wedge
#

Let me check if thats works let you guys know 🙂

zealous osprey
# golden kelp bumpp

If you want them to disappear when hitting the ground, you might need to add all created falling sand entity instances to a list, iterate over it and check if the y velocity is under a certain threshold.

#

other option, if you want it to be applicable if the cobwebs stop moving all together, take the length of the movement vector and check if that is under a certain threshold.

golden kelp
#

just want them to make a proper 3x3 cube

zealous osprey
#

oh now I get it... not sure

sacred mountain
#

anyone got a neat util for particle bounding boxes before i code it myself

zealous osprey
# golden kelp just want them to make a proper 3x3 cube

easiest would be to make a custom model for it ig?
Cause otherwise you'd need to anchor all other webs on some webs position, like let's say, you take the bottom middle web, then set all of the other webs relative to that one and teleport them ever tick.
This'll look weird unfortunately.

golden kelp
#

easiest would be to make a custom model for it ig?
How

zealous osprey
#

resourcepacks

golden kelp
#

ohhhhh i got an idea

#

is there any event when a fallable block entity reaches its destination?

#

i can listen for that and then spawn blocks around it rather than sending

zealous osprey
#

destination?
Wait, are you concerned that at the end it should look like a 3x3 cube, or when it's flying?

zealous osprey
rain mason
#

for some reason, when I do CompletableFuture.get, it will completly just crash the server, anyone know why?

eternal oxide
#

you are locking the main thread waiting for the future to complete

rain mason
rain mason
eternal oxide
#

depends how fast/slow the code runs

rain mason
#

alr, how would I run it in a different thread?

sacred mountain
#

async stuff

rain mason
amber vale
#

Caused by: java.lang.IllegalStateException: Holographic Displays did not load properly (no API implementation was set)

Anyone know how to fix this? I've implemented the api as the github says:

HolographicDisplaysAPI hdAPI = HolographicDisplaysAPI.get(Core.getInstance());

https://github.com/filoghost/HolographicDisplays/wiki/Basic-tutorial
(github for reference)

GitHub

Create modern looking holograms in Minecraft. Contribute to filoghost/HolographicDisplays development by creating an account on GitHub.

charred blaze
#

i think you should enter there hd's instance and not ur core's if not im saying something dumb

amber vale
charred blaze
#

HolographicDisplaysAPI hdAPI = HolographicDisplaysAPI.get(Core);

#

try this ig

amber vale
#

That's just not a thing in java

charred blaze
#

idk then

rain mason
golden kelp
obsidian drift
#

Is there a way to get an inventory's name just from org.bukkit.inventory.Inventory?

sacred mountain
#

i love making complete useless plugins

#

made a trajectory calculator that is somewhat right most of the time

golden kelp
#

nice

#

i need some of your ideas then

#

cuz i need to make the most stupid plugins for m yyt vid

amber vale
#

Do entities have some unique tag, or do I have to manually assign mobs those?

maiden briar
#

How can I randomise all structures? I would like to for example replace a nether fortress with a village, or a village with an end city. The places will not differ, I only want to generate random types

grim ice
#

bro

#

ithinkim.gay

#

is legit 3$ a year

#

lmao

#

i feel like buying that domain ngl

#

amongus.art is 2$/year

#

💀

hasty fog
#

Anyone here familiar with this error: java.lang.classformaterror: invalid start_pc 95 in LocalVariableTable

#

out of nowhere the JavaPluginLoader can't read my jar on some servers

eternal oxide
#

are you encrypting it?

hasty fog
#

no

eternal oxide
#

obfuscating?

hasty fog
#

also not

eternal oxide
#

Thats the end of my guesses

wet breach
#

not all versions are fully compatible with each other

#

compile too far back and you will eventually encounter some new versions of java that no longer understands the bytecode because they don't exist in those versions or are something else

hasty fog
#

Aha, makes sense. Thank you very much :)

eternal oxide
#

you can't

#

well, you can read chunk data so long as its already loaded

#

?configs

undone axleBOT
eternal oxide
#

ok you are not on about a world map then

#

use a concurrentmap

#

just makes access safe

dusk flicker
#

all those messages just get deleted?

eternal oxide
#

one by one

dusk flicker
#

interesting

eternal oxide
#

chat event

#

and some java

#

using the link I already gave you

rain mason
#

this is my code: ```java
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
try {
String fresp = futr.get();

        pl.closeInventory();
    } catch (InterruptedException | ExecutionException ex) {
        ex.printStackTrace();
    }
}

});```
how would I run pl.closeInventory without it throwing an error?

#

if I don't run it asynchronously, the (CompletableFuture) futr.get() throws an error and crashes my entire server

solid jungle
#
package aioplugin.aioplugin.events;

import aioplugin.aioplugin.database.MongoConnect;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.jetbrains.annotations.NotNull;

import java.util.Objects;
import java.util.UUID;

public class PlayerJoinEvent implements Listener {

    @EventHandler
    void onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event){

        if(event.getPlayer().hasPlayedBefore() == false){

            @NotNull String PlayerName = event.getPlayer().getName();

            UUID uuid = event.getPlayer().getUniqueId();

            String IP = event.getPlayer().getAddress().getAddress().toString().split("/")[1];

            MongoConnect.NewJoinsData(PlayerName, uuid, IP);

        } else {
            System.out.println("e");
        }

    }

}
```im wondering if `event.getPlayer().getAddress().getAddress().toString().split("/")[1]` would get the players actual ip?
#

or no

rain mason
#

yeah, it should I think

solid jungle
#

thanks

vocal cloud
solid jungle
#

k gonna try it and see if it work

tender shard
#

easy

#

create a new scheduled task to close the inventory

eternal oxide
tender shard
#

e.g. sth like this

Bukkit.getScheduler().runTask(myPlugin, () -> pl.closeInventory());
civic wind
#

Any help with this gui? Everything works but the item display name and lore aren't. No errors

rain mason
#

ohhhh i didnt even notice I can run it without the Asynchronously thanks

#

it autocompleted it and I had no iea

tender shard
#

some things work fine async, but most things require to run "on the main thread"

carmine pecan
solid jungle
#
event.getPlayer().getAddress().getAddress().toString().split("/")[1]
``` when i tried to get the players ip, it just returned 127.0.0.1 in my db
tender shard
#

or another kinda proxy?

solid jungle
tender shard
#

hm well

civic wind
#

How do i do this? @carmine pecan

rain mason
carmine pecan
#

Item#setItemMeta

tender shard
eternal oxide
#

you are on teh same PC as the server you are testing on?

solid jungle
solid jungle
tender shard
#

yes, then it's correct

solid jungle
#

Ah

eternal oxide
#

127.0.0.1 = localhost

solid jungle
#

i should test it on someone else then?

tender shard
#

because when you connect to your own server on the same machine, it of course doesn't use your public IP address

tender shard
solid jungle
carmine pecan
tender shard
#

if you connect to localhost, your OS is smart enough to say "okay no problem, we don't need to use the public IP, it's the same machine anyways"

rain mason
#

aand here goes the CompletableFuture.get error again

tender shard
civic wind
rain mason
#

future.complete is in a InventoryClickEvent

tender shard
hardy swan
#

hello guys

tender shard
# rain mason

I am wondering - why do you use a future if you just call .get() on it anyway?

#

that's kinda pointless

hardy swan
#

i wanna learn how to make a plugin

rain mason
#

is there any better way of doing it?

tender shard
#

a future is to do stuff that needs to "wait" for stuff, e.g. database queries or file i/o

tender shard
hardy swan
#

I know CompletableFuture definitely

civic wind
hardy swan
#

how can you wait for an event from main thread in CF

#

does it even work

tender shard
#

CF?

#

what is CF

rain mason
hardy swan
#

completablefuture

tender shard
#

e.g. andThen(() -> doStuff());

hardy swan
#

but he is waiting for a player to pick a block

eternal oxide
#

completely pointless though. Thats the whole purpose of an Event driven system

rain mason
tender shard
rain mason
#

I wish it was as easy as this ```js
let waitForChoice = {}

doSomething();
waitForChoice[identifier] = (choice) => {
console.log(choice);
}

// somewhere else

waitForChoiceidentifier```

tender shard
#

then, in the click event, check if the player who just clicked something is actually having your custom GUI open

#

and then just do what you wanna do

tender shard
rain mason
#

it's so weird tho, CompletableFutures worked when I was using a playerAsyncChatEvent

young knoll
#

You can make a custom inventory that takes in 2 consumers, one for a yesAction and one for a noAction

tender shard
#

ofc futures work, but you cannot use them like this

tender shard
rain mason
tender shard
#

(too lazy to make a Clan class)

#

you should definitely make a Clan class

#

that's why java is so awesome

#

you can turn everything into your own custom object

#

and you should really do that

rain mason
#

i mean all I am doing is .set and .get so dunno

tender shard
#

it will save you many future headaches

#

Trust me & just make it an own class

#

you will be happy about it in the future 😄 fr

rain mason
#

finee

tender shard
#

I basically always turn everything into an object

rain mason
#

yeahh I already made a class for player heads and adding so many unnecessary functions is so fun

rain mason
#

like new CoolHead().grayOakWoodArrowLeft().getItem()

tender shard
#

oh ok

#

fair enough

#

after all this is java - you should have your own class for EVERYTHING that stores data

#

instead of "abusing" YamlConfigurations

rain mason
#

can I just do class Clan extends YamlConfiguration

tender shard
#

you should always write some kind of wrapper class for your custom objects

rain mason
#

and add some functions to it

tender shard
#

what kind of data does your Clan need to store?

rain mason
tender shard
#

Probably stuff like
UUID owner
List<UUID> member
etc right?

#

Oh ok I see

rain mason
#

oh god I just noticed setings.joinrequests

#

oops

tender shard
#

yes, you should have your own class for that, and NO, it should NOT extend YamlConfiguration

rain mason
tender shard
onyx fjord
#

i wish java was more like js

rain mason
#

same

onyx fjord
#

but less than ts

tender shard
#

I am so totally happy that java is different from JS

hardy swan
#

happy for which one

onyx fjord
#

java dev when boilerplate:

tender shard
onyx fjord
#

i heard ppl dont like lombok

hardy swan
#

there are other languages

tender shard
onyx fjord
#

clojure, haskell 🥵

hardy swan
#

hot

tender shard
#

and please stop talking about haskell

#

haskell is a huge pile of shit

#

invented by people who can't code

onyx fjord
#

Xmonad users are offended by you

tender shard
#

haskell is the answer to a question noone ever asked

onyx fjord
#

you know what else nobody asked for

#

kotlin

tender shard
#

I gotta admit that I also extremely dislike kotlin

onyx fjord
#

i asked my dad for kotlin

#

because its a ketchup

tender shard
#

java is mayonaise

#

kotlin is ketchup

#

we all know that mayo is better

onyx fjord
#

coffee in polish is kawa

ivory sleet
#

We also know mayo and ketchups interoperability sucks

onyx fjord
#

👋 hi conclure

ivory sleet
#

Hellu :>

tender shard
onyx fjord
#

you know what im gonna do right

ivory sleet
#

🥲

sour wedge
onyx fjord
#

conclure more like clojure

tender shard
#

yes, wassup mr conclure dude

#

@ivory sleet since youre here anyway, can you help me maybe

lucid crow
#

Hey

ivory sleet
rain mason
#

@tender shard hi rq is there a way to get the plugin like Bukkit.getPlugin or something

tender shard
#

@ivory sleet I got this and I have no idea what exactly the problem is

onyx fjord
rain mason
#

dont really want to do new Clan(plugin) every time

lucid crow
#

Someone can give me link to download spigot api (api for plugins)

onyx fjord
tender shard
onyx fjord
#

optic is online btw

ivory sleet
#

Yeah gonna have to delegate that to optic

onyx fjord
#

lets move to #general

tender shard
onyx fjord
tender shard
#

we DM each other very often

#

but then he just removes me as friend

#

and now I cant DM him anymore lol

sour wedge
tender shard
#

otherwise it's hard to read

onyx fjord
#

yeah use ```

tender shard
#
// Here goes your java code
#

like this pls

heady leaf
#

is there a way to disable the shift+rightclick itemframe rotation?

sour wedge
#
This is my code, so when i join with player_1 it shows the border, When i join with player_2 its resets player_1 and instant died p1

@EventHandler
public void onJoin(PlayerJoinEvent event) {

    Player p = event.getPlayer();

    WorldBorder wb = p.getWorld().getWorldBorder();
                    
    wb.setCenter(new Location(p.getWorld(),(is.chunkX*16)+8,0,(is.chunkZ*16)+8));
    wb.setSize(Island.getIslandSize(p));
                
    p.setWorldBorder(wb);

} 
tender shard
tender shard
tender shard
#

no, it isnt

#

you are setting the ACTUAL world border

#

there is Player#sendWorldBorder

#

use that instead

floral drum
#

hi conclure ❤️

heady leaf
floral drum
#

if he still here

tender shard
sour wedge
floral drum
#

omg alex ❤️

tender shard
ivory sleet
floral drum
#

hope y'all have a good rest of your days ❤️

ivory sleet
#

The feeling is mutual :>

tender shard
#

it's "setWorldBorder"§

young knoll
#

They are using that atm

floral drum
#

no cap game dev tycoon is so fun

young knoll
#

Problem is they are modifying the main border

tender shard
floral drum
#

😭

azure hawk
#

how is the event called when somethin is getting "updated" in a players inventory e.g. he picks up an item, hes given an item per /give, he craftest one and drags it into his inv and that stuff. How is that called xd ^^ thx

young knoll
#

You need to make a new worldborder instance

tender shard
#
  1. InventoryClickEvent
  2. EntityPickupItemEvent
  3. ... I forgot the rest, but it's definitely more than just one event
heady leaf
young knoll
#

I wish we had an InventoryChangeEvent 😔

tender shard
floral drum
#

InventoryDragEvent, InventoryClickEvent, PlayerPickupItemEvent, InventoryInteractEventt

tender shard
floral drum
#

and maybe some others

#

idk

young knoll
#

Vanilla has that as an advancement criteria, so it should be possible

tender shard
sour wedge
tender shard
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

floral drum
#

lol

young knoll
#

Probably something that could be made

#

Quick bug choco to do it

tender shard
#

wdym?

wet breach
#

you could just hook into the logger for this since it already does this

sour wedge
# tender shard ?notworking

Please read my issue first
This is my code, so when i join with player_1 it shows the border, When i join with player_2 its resets player_1 and instant died p1

heady leaf
tender shard
#

and so I did ?notworking

sour wedge
tender shard
#

just don't do anything. vanilla logs exactly this by default

tender shard
young knoll
floral drum
#

hi optic ❤️

tender shard
#

because if you just say "its not working", that's so useless

floral drum
#

good morning

wet breach
# sour wedge your solution is already in my code ? not...

such attitudes is inconducive to the environment of this discord. Recommend re-evaluating how it is you are asking for help. You are not entitled to help so if you cause problems you risk in everyone choosing to ignore you which they are free to do.

floral drum
#

hi frosty ❤️

tender shard
#

sounds scammy

wet breach
#

you could alter the logging properties to probably get the results you are wanting. Log4j is configurable

tender shard
#

I don't really understand what you're trying to do

heady leaf
#

Itemframe problem

floral drum
#

uhm

tender shard
#

as I said - chat messages and commands entered are in the logs anyway

wet breach
floral drum
#

too many warns? what's it saying lol

sour wedge
#

Exactly what i saying, the border removed when new player joins on a other location,

young knoll
#

ConsoleSpamFix time

tender shard
civic wind
#

Still not working

tender shard
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

young knoll
#

I think it’s Bukkit.createWorldBorder or something

tender shard
#

I fucking hate it when people say "not working"

civic wind
tender shard
#

I mean.... explain to us please what exactly "is not working"

civic wind
#

It's already been said LOL

#

I'm following up

tender shard
civic wind
#

The lore is not working, i've stated it about 5 times.

tender shard
#

I mean I could also say "I've tried to go outside but it wasn't working"

civic wind
#

Cringe

tender shard
#

that's not really helpful, is it?

jade grove
sour wedge
tender shard
#

It would be helpful to say "I tried to go outside but the door was locked, so it didnt open"

civic wind
tender shard
#

that would make sense

civic wind
#

Gui, Lore not working

tender shard
#

but just saying "Its not working" is just bs

civic wind
#

I have already said about 5 times

civic wind
tender shard
#

that's because you change the lore AFTER you set the item meta

#

first, change the lore, and THEN set the item meta

civic wind
#

That's how i've done it no?

jade grove
tender shard
#

no

civic wind
tender shard
#

you first set the item meta, and then you changed the lore

#

and that's why it didn't work

young knoll
#

Modify that one and set it to a player

tender shard
#

@civic wind Basically you just have to set the lore, and then at the very end of your method, do item.setItemMeta(myNewMetaWithUpdatedLore)

#

then it should work 🙂

jade grove
# civic wind Yes mate

make a class for the item you're making, having the necessary attributes (lore, etc)

inside that class make an update method, updating the item's meta and call that everytime you want to update the item's lore

wet breach
# civic wind That's how i've done it no?

it also helps to show some code, applies to others as well. Sometimes you need to show more code. Also need to learn to better rephrase your problems if others who are wanting to help are not quite understanding.

#

this doesn't just apply to you, but others as well

sour wedge
tender shard
#

And we already explained it to you twice, or thrice

#

Please show your current code

#

?paste it