#help-development

1 messages · Page 937 of 1

sand spire
#

what if the player changes the skin?

chrome beacon
#

nothing will change

plucky skiff
chrome beacon
#

you're storing a reference to the skin texture rather than the players active skin

chrome beacon
sand spire
chrome beacon
#

yeah if you want to keep using the same skin just save the url somewhere

sand spire
#

alright thanks

plucky skiff
chrome beacon
#

in the ide when you reload

plucky skiff
#

mhm

#

yeah I got this:

TreasureBattle:main: Could not find com.github.StillLutto:LuttoLib:0.0.1.
Searched in the following locations:
  - file:/C:/Users/iAmEi/.m2/repository/com/github/StillLutto/LuttoLib/0.0.1/LuttoLib-0.0.1.pom
  - https://repo.papermc.io/repository/maven-public/com/github/StillLutto/LuttoLib/0.0.1/LuttoLib-0.0.1.pom
  - https://hub.spigotmc.org/nexus/content/repositories/snapshots/com/github/StillLutto/LuttoLib/0.0.1/LuttoLib-0.0.1.pom
  - https://oss.sonatype.org/content/groups/public/com/github/StillLutto/LuttoLib/0.0.1/LuttoLib-0.0.1.pom
  - https://repo.maven.apache.org/maven2/com/github/StillLutto/LuttoLib/0.0.1/LuttoLib-0.0.1.pom
  - https://jitpack.io/com/github/StillLutto/LuttoLib/0.0.1/LuttoLib-0.0.1.pom
Required by:
    project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

chrome beacon
#

Looks like it can't find your lib

#

I assume you didn't publish it to your local maven repo

plucky skiff
#

which is weird since I grabbed it from jitpack

plucky skiff
chrome beacon
#

you have a build error on JitPack

plucky skiff
#

oh now it show

#

ty tho

twin venture
#

Finally after getting yelled at , and bullied by someone xD
i finished my sql lib :p

#

if i want to create a new table with data :
just like that

plucky skiff
#

nice

twin venture
#

also

#

you can make your own Data class for example a user class with uuid , wins , kills , deaths

plucky skiff
chrome beacon
#

There's also another issue which it also tells you how to fix

plucky skiff
lost matrix
# twin venture

How do you handle N-to-many relations? Like a List for example.

proud badge
#
        if(player.hasPermission("antiillegals.bypass")) {
            return;
        }
        if(item != null && item.getType() != Material.AIR) {
            if(AntiIllegals.getInstance().getIllegals().contains(item.getType())) {
                item.setType(Material.AIR);
               
                return;
            }``` Did I mess something up? The line of code is fired, but the item does not get removed
chrome beacon
#

don't set the type to air

inner mulch
#

Is it fine to create entities not with packets when i turn the ai off, or do they still take lots of memory?

chrome beacon
#

It's fine

inner mulch
#

i want to do this to save my sanity from maintaining packets, but im not sure how expensive it is to cancel all the events and handle the visibility.

young knoll
#

what events

inner mulch
#

EntityCombustEvent, or EntityTrqckEntityEvent (paper) to handle them

young knoll
#

I mean you can make them invulnerable which probably disables catching fire

inner mulch
#

Okay then this is fixxed, but the tracking one is needed to Show it to only specific playerd

young knoll
#

Use uhh

#

showEntity and hideEntity

inner mulch
#

Yes but when i cancel the tracking they are never shown and this means less iterating over all players and hiding the entity

young knoll
#

setVisibleByDefault

inner mulch
#

Im not sure what hideentity does internally but i think its more expensive then cancelling

inner mulch
#

Nice

inner mulch
young knoll
#

I mean they still tick some things

lilac dagger
#

it still has to be visible when in range and handle gravity

inner mulch
#

What can the entity tick at this point?

lilac dagger
#

it's best if you check the nms and see what setai does

inner mulch
#

i dont know how to decompile stuff

young knoll
#

Mobs with no ai don’t have gravity

#

But it still ticks data changes and such

inner mulch
#

this is not expensive tho even if i would spawn 1000 of them?

young knoll
#

?tas

undone axleBOT
inner mulch
#

im not experienced, i dont even know if 1000 entites spawned with packets cause lag

young knoll
#

That’s what testing is for?

undone axleBOT
young knoll
#

We can’t magically tell you how well your server will handle it

inner mulch
#

?

inner mulch
young knoll
#

No

inner mulch
#

so 1000 packets entities are cheaper. do you know by how much? or is the amount so low to not care about?

young knoll
#

No idea

river oracle
#

His server will crash

river oracle
inner mulch
#

does some1 know if an entity doesnt see another entity, for example a zombie doesnt see a turtle. Will the zombie also not react to the turtle?

twin venture
#

not sure

minor grotto
#

Does anyone know how to cancel blocks sent by packets disappearing when the player leaves the area using ProtocolLib?

twin venture
#

anyone know how i can make the library i have be loaded inside my main plugin?without the need of having the lib in plugins folder?

jagged bobcat
jagged bobcat
eternal oxide
twin venture
abstract nebula
#

Hey, I'm looking for a way to use a BaseComponent as the title of an inventory in order to use a custom font

echo basalt
#

I believe you need to use either NMS or paper for that

#

There's no native way in the spigot API

#

If you're using paper, you can pass a component on the inventory title

#

WIth NMS you need to be inventive

twin venture
#

Hello so , iam trying to remake my skypvp plugin from zero , iam working on lootbox now , and i just wonder what is the best data base i can use to save lootboxes , and load them when i need?

#

in the past i used json for each lootbox

#

so common.json , rare.json

#

it was great , but it was hard for some users to use it

#

any advices :p?

rough ibex
#

JSON is pretty easy to edit.

#

You can try switching to YAML if you want even more leniency

#

and less structural rigidity

twin venture
#

i was thinking about using Packets to spawn the Custom Entity

#

but again , i need to support every version :L

#

old 1.8.8 and new , cuz my customers 90% use 1.8.8 ..

rough ibex
#

That's on them

#

1.8 is dead

twin venture
#

well not for them

drowsy helm
rough ibex
twin venture
analog mantle
#

Is there a method I can do to wait x miliseconds without spinning up a new thread?

echo basalt
#

You can use an ExecutorService to run a task after X time

#

Or the bukkit scheduler if that's your thing

analog mantle
echo basalt
#

You can make it a constant and reuse it

#
private static final ScheduledExecutorService EXECUTOR = Executors.newScheduledThreadPool(1);

EXECUTOR.schedule(() -> {

}, 123, TimeUnit.MILLISECONDS);
analog mantle
#

Can you tell me more about the latter?

echo basalt
#

?scheduling

undone axleBOT
echo basalt
#

It's not millisecond accurate but the server uses ticks

#

And "so should your code"

#

Each tick is 50ms under perfect conditions but things can deviate if the main thread hangs

analog mantle
#

I dont care about the code, I am extremely familliar with lambdas and runnables. I need to know how to actually use the sheduler

#

90% of this is just code

#

I know how to use it all

echo basalt
#

Great so let's be brief

#

You have 4 variants:

  • Delayed tasks on the main thread
  • Repeating tasks on the main thread
  • Delayed tasks off the main thread (async)
  • Repeating tasks off the main thread (async)
#

And at least 2 methods to schedule each variant, one's the schedule... and the other is the runTask...

#

You want to use the runTask methods

native nexus
#

Javadocs tell you everything

echo basalt
#

So for scheduling a delayed task on the main thread, the method's runTaskLater(Plugin, Runnable, Delay Ticks)

#

Etc

#

runTaskLater, runTaskAsynchronously, runTaskTimer and runTaskTimerAsynchronously are the methods you want

#

The only difference is that the timer methods (repeating) have a second parameter

#

The first parameter is the delay ticks until the first iteration and the second parameter is the amount of ticks between iterations

#

You can also replace your Runnable with a Consumer<BukkitTask> on the timer methods in case you want to cancel the task from itself

analog mantle
#

Thanks

short plover
#

I have 2 minecraft instances open right now, and on one of my accounts if I do anything that swings my arm, it wont show that it swinged my arm from the other instance

#

but if I swing my arm from the other minecraft instance it shows that im swinging my arm just fine? anyone got a clue why this is happening

#

starting to think my account is cursed 💀
player.swingMainHand(); doesn't do anything for only one of my accounts aswell so idk whats going on

#

Okay I found the problem, I think it was something in the playerdata file that was making it so that it wouldn't send the arm animation packet to the players around and it would also ignore swing arm packets getting sent from the server to the client, cause clearing the playerdata file just magically fixed the problem

low marlin
#
    @EventHandler
    public void onChatEvent(ChatEvent event) {
        
        ProxiedPlayer p = (ProxiedPlayer) event.getSender();
        String msg = event.getMessage();
        
        if (msg.startsWith("#")) {
            
            event.setCancelled(true);
            
            for (ProxiedPlayer online : ProxyServer.getInstance().getPlayers()) {
                
                online.sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
                
            }
            
        }
        
    }

Trying to setup a bungee staffchat plugin but getting kicked for Received chat packet with missing or invalid signature.
anybody knows how to fix?

lost matrix
low marlin
#

It's deprecated, I'm new with bungeecord so I'm just testing some stuff

lost matrix
#

You should generally avoid using any deprecated methods in java.
If its deprecated then there is an alternative.

low marlin
#

Noted

muted dirge
#

Is velocity related to ai for mobs?

lost matrix
muted dirge
#

and i dont want it to move

#

so i turned off ai

lost matrix
muted dirge
lost matrix
#

That wont work. setAI to false will prevent it from being ticked for movement as well.

muted dirge
#

what should i do

lost matrix
#

Implement a custom pathfinder in nms

muted dirge
#

and i want to avoid nms if unnecessary

lost matrix
#

Just setting the velocity will look weird. You need to actually add your own pathfinder goals.

low marlin
low marlin
#

It's not about the send message

#

it's about the Received chat packet with missing or invalid signature.

lost matrix
#

What method do you call?

low marlin
#
@EventHandler
    public void onChatEvent(ChatEvent event) {
        
        if (!event.isCommand() && !event.isProxyCommand()) {
            ProxiedPlayer p = (ProxiedPlayer) event.getSender();
            String msg = event.getMessage();
            
            if (p.hasPermission("BungeeCord.StaffChat")) {
                if (msg.startsWith("#")) {
                    event.setCancelled(true);
                    ProxyServer.getInstance().broadcast("test");
                }
            }
            
        }
    }
#

Cancelling the event does this but I have no idea how to fix it

remote swallow
#

by cancelling the event you stop the message which ig mojang class as changing it

lost matrix
low marlin
#

how

#

enforce-secure-profile is already on false

#

The thing is I tried putting on a different plugin using the same prefix and cancelling the message event and it does work

lost matrix
low marlin
#

nope

#

but that's because it doesn't run the event no?

lost matrix
#

I was just checking if you have other listeners which could cause this

low marlin
#

oh

#

is it because of the bungeecord version maybe?

#

or something I set up wrongly in the pom.xml

#
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>Bungee</groupId>
  <artifactId>BungeeCord</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  
      <repositories>
        <repository>
            <id>bungeecord-repo</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>net.md-5</groupId>
            <artifactId>bungeecord-api</artifactId>
            <version>1.20-R0.1</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.md-5</groupId>
            <artifactId>bungeecord-api</artifactId>
            <version>1.20-R0.1</version>
            <type>javadoc</type>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    
    
  
</project>
lost matrix
#

I would def change your group and artifact id...

#

Not that it causes this problem. But still

#

Update your Bungeecord server to the latest version

low marlin
#

okay

#

still happening ;-;

lost matrix
#

What happens if you just broadcast the message without any event being cancelled?

low marlin
#

checking

#

works fine

lost matrix
#

And what happens if you cancel the event without broadcasting a message?

low marlin
#

kicks me with the chat packet with missing or invalid signature

lost matrix
#

Alright, sounds like you need to simply not cancel the event...

#

Wait...

low marlin
#

waiting

lost matrix
# low marlin waiting

Try this (cleaned up your code with guard clauses a bit)

@EventHandler
public void onChatEvent(ChatEvent event) {
    if(!(event.getSender() instanceof ProxiedPlayer)) {
        return;
    }

    if (event.isCommand() || event.isProxyCommand()) {
        return;
    }

    ProxiedPlayer p = (ProxiedPlayer) event.getSender();
    String msg = event.getMessage();
            
    if (!p.hasPermission("BungeeCord.StaffChat")) {
        return;
    }

    if (!msg.startsWith("#")) {
        return;
    }

    event.setCancelled(true);
    ProxyServer.getInstance().broadcast("test");
}
low marlin
#

still happening

#

this is frustrating

lost matrix
#

Alright, then the only way is not cancelling the event.

low marlin
#

Combining a spigot plugin that does the same thing with the same permissions and stuff is also possible and then the cancelling will be spigot sided

#

But yeah thanks for trying anyways

#

appreciate it

low marlin
#

yeah I did

bronze crystal
#

does anyone have nice small/medium plugin ideas?

lost matrix
muted dirge
#

its GoalSelector

#

right?

mellow edge
#

I do not understand the point of this plugin, is it something related to mojang mappings because I am using spigot mappings because in 1.8 those were the only mappings:

<plugin>
                <groupId>net.md-5</groupId>
                <artifactId>specialsource-maven-plugin</artifactId>
                <version>1.2.2</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-obf</id>
                        <configuration>
                            <srgIn>org.spigotmc:minecraft-server:1.20.1-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
                            <reverse>true</reverse>
                            <remappedDependencies>org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
                            <remappedArtifactAttached>true</remappedArtifactAttached>
                            <remappedClassifierName>remapped-obf</remappedClassifierName>
                        </configuration>
                    </execution>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-spigot</id>
                        <configuration>
                            <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                            <srgIn>org.spigotmc:minecraft-server:1.20.1-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
                            <remappedDependencies>org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

slate surge
#

is it possible to cancell the event of a player quitting 💀

smoky anchor
slate surge
#

XD

muted dirge
slate surge
#

but anyways now i want that when the player quits the player should die

muted dirge
#

alt f4 works btw

mellow edge
#

Why would I want that?

chrome beacon
#

You want your plugin to run

muted dirge
#

to use it?

chrome beacon
#

so you need to do that

lost matrix
muted dirge
#

if you dont reobfuscate it it wont work

chrome beacon
#

I mean you could just write obfuscated nms directly

#

but that's harder and custom entities won't compile

mellow edge
#

I am not used to it since the only nms I've used is 1.8 and there I did not need that

mellow edge
chrome beacon
#

yeah

#

that will just give an obfuscated dependency

mellow edge
#

(With spigot mappings)

tired star
#

Hey, im making a plugin that gives a player the ability to cast thunder from the sky. The problem is that i cant seem to detect the fires that bukkit strikeLightning method does around the strike location. I want to put them out. Anyone got any ideas for this

calm lichen
#

i am having trouble making it so that when a player types a command that my plugin makes it actually does anything, could anyone help lead me in the right direction or some resources i could look into regarding this?

icy beacon
undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

calm lichen
#

i have coded 2 commands, and implemented them properly as far as i know, when the server boots up it says the plguin is running, but when a player types the command there is no response

icy beacon
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

calm lichen
#

what is the most appropriate way to send my code in this discord?

icy beacon
#

?paste for large code blocks

undone axleBOT
icy beacon
#

or if it's not large just encapsulate it in code blocks

#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
calm lichen
icy beacon
#

if (label.equalsIgnoreCase("balance") || label.equalsIgnoreCase("bal")) {
This is redundant. The onCommand only eve gets called with the command you registered it with, in your case it's "balance":
getCommand("balance").setExecutor(new BalanceCommand(currencyManager));

#

Try removing it and running the command again

#

Also show your plugin.yml

wet breach
#

label probably shouldn't be used

#

you should be using command.getName() I think it is, if you want to check the command

#

label is for aliases

#

when there is no aliases registered, which you don't always have control over it defaults to the main command

#

however the user could create aliases in the appropriate commands.yml

#

if an alias does get registered to your command, your command eval there will not work

#

your second label check is an appropriate alias, and you should register it as such

#

then you effectively remove the double check

#

because aliases always invoke the commands they are registered to and you could just check the command 🙂

calm lichen
#

as such?
'''java
if (command.getName().equalsIgnoreCase("balance")|| label.equalsIgnoreCase("bal")) {
// Check if the sender is a player
if (!(sender instanceof Player)) {
sender.sendMessage("Only players can use this command!");
return true;
}'''

wet breach
#

well its a start

#

should learn how to register aliases for your commands

#

then you would reduce it to no checks needed 😄

#

unless you wanted to do something different based on the alias used

calm lichen
#

alright i have followed the advice that has been given however, it still looks like i am not getting a response either in game or from consol

smoky anchor
#

your plugin.yml does not register a command

icy beacon
#

Yep

calm lichen
#

oh lord

#

mb lmao

icy beacon
#

The plugin should crash if you try to call getCommand on an unregistered command iirc

#

So not sure how yours wasn't lol

calm lichen
#

thats what i thought too, hence why i thought it was all good

chrome beacon
#

It probably did

#

It doesn't crash but it does throw an error in the console

calm lichen
#

nothing was showing in consol

#

afterwords

icy beacon
chrome beacon
#

no

#

It can disable itself

icy beacon
#

Yeah from my experience the plugin shuts down if an error is uncaught in onenable unless i'm confusing smth

chrome beacon
#

yeah the plugin disables itself

#

It doesn't crash anything though

icy beacon
#

Bad wording on my part ig. I used "crash" and "shutdown" synonymously

calm lichen
#

right but then my on disable code wouldve been shown in consol right?

#

which was not the case

chrome beacon
#

Not sure if it runs the onDisable if it gets disabled because of an exception

icy beacon
#

Maybe some other plugin registered a "balance" command and Bukkit found it

chrome beacon
#

^^ this too

calm lichen
icy beacon
#

This is for you to decide, but for commands you could use a library, such as ACF, which would handle some heavy lifting for you and only leave the command implementation itself to you

#

Though if you're just learning to make plugins I'd say it's better to first experiment with just spigot

pallid oxide
#

I prefer Commandapi by jorel

icy beacon
#

zoltus

drowsy helm
#

There is no good reason why commands should be defined in-line vs in their own class, just makes it messy

fallen lily
#

For example for parties

pallid oxide
fallen lily
#

I have a party.kt file where the data structure for parties is declared, the main manager which handles storage and various other events, and the commands

#

One of the blessings of Kotlin really

#

Being able to declare more than just a class and interface in a single source file without creating inner class porn

#

Technically you can declare classes and interfaces without access modifiers but they cant be referenced outside of the file

inner mulch
#

when using the RLiveObjectService, how can i count all live entities of one class?

inner mulch
#

yes counting them?

fallen lily
#

Literally

#

The function called „count”

inner mulch
#

yes but there a parameter called condition

fallen lily
#

Yes

inner mulch
#

so it only counts under certain condition

#

i want all

fallen lily
#

Pass null

#

Lol

#

Condition seems to be an empty interface

#

So it probably does instanceof checks

#

And logically speaking if the condition supplied is null, it is “unconditional” therefore it should return all entities

inner mulch
fallen lily
#

Thats my hypothesis this is my first time seeing this library code

inner mulch
#

illegalargumentexception

fallen lily
#

stack trace?

#

Full trace

inner mulch
#

not needed it doesnt allow null as condition

fallen lily
#

Yes i am aware of thst

#

Im asking for the trace to make my life easier as github source viewer doesnt have reliable xref

#

I can see it calls into SearchEngine#find

#

Ok well

#

Idk how the fuck they expect you to do it

#

But logically i would make an “unconditional” condition

inner mulch
fallen lily
#

Yeah it does do what I thought it would do though

#

Except instead of falling through snd adding all entities

#

It gives you an exception

ocean hollow
#

How does textDisplay interpolation work? I set the delay to 0, duration to 20. And there is no animation

young knoll
blazing ocean
#

most certainly not because of that

#

well then why is it that you cant place blocks because of a tab completer then?

native ruin
#

are you sitting in spawnchunks without op?

blazing ocean
#

tell me your reasoning why you think thats the case because thats not the issue

#

yeah what do you expect

#

a tab completer is 100% unrelated to block placement

#

try printing player in the event

#

because it likely has yourself in it because you ran the command

ocean hollow
#

how can I make sure that the message is not replaced, but the animation is played again as the message appears? I thought about doing this, but nothing has changed (I think the problem is that the code is executed in a split second, and it does not have time to execute 2 animations one by one).

rapid vigil
#

what works

mortal hare
#

guys you should checkout scoop for windows

#

such a good package manager

#

you can install many of the programs at the user level

#

without having to go through all all setup wizards

eternal oxide
#

windows doesn;t need a package manager

mortal hare
#

it does

blazing ocean
#

yes it does; still off-topic

mortal hare
#

i hate msi's

#

and exe wizards

blazing ocean
#

pacman for windows when

eternal oxide
#

Been using it since Win 3.0 and never even been tempted by a package manager

mortal hare
#

or chocolatey, but i dont like choco

#

winget is also good

#

but scoop is the best for me imo because it install per user not system wide

#

that means you can use scoop for whatever pc you want even without admin access to get those programs without searching for portable versions

#

and you can make your own repos (buckets) by just creating git repo with a simple json file that would point what to do for a package manager

blazing ocean
#

pacman is the best package manager for linux (i use arch btw)

mortal hare
#

i agree pacman is great and the best

#

core 2 duo?

#

what potato are you running arch on 😄

blazing ocean
#

thinkpad t400

mortal hare
#

thinkpads

#

also marvel of hardware

blazing ocean
eternal night
#

Yay moment

mortal hare
#

wtf

rare ridge
#

Hello, how can I update the %update% placeholder in my menu every second, so that when the player hovers over an item and time passes in real time, and not every time he opens the menu

eternal oxide
#

you can;t

#

as the item meta is sent on opening the inventory

#

you'd have to keep updating the meta in a timer, but then the item will flash as its updated to be a new item

rapid vigil
eternal oxide
#

lore is in the metas

rapid vigil
#

it would flash if he is setting it to a new item

#

but if he is editing the current item?

eternal oxide
#

put a compas in your hotbar and constantly update teh tracked location. it will flash constantly

rapid vigil
#

a lot of servers update their menu's items and they never flash tho

rapid vigil
#

^^

eternal oxide
#

interesting

rapid vigil
#

ive tried working with updatable items myself and they dont flash

eternal oxide
#

I know hotbar items do, like the compass

young knoll
#

They will look weird if you are holding them in your hand

minor junco
young knoll
#

But they won't flash just being in an inventory

eternal oxide
#

I guess its different for an inventory

rapid vigil
eternal oxide
#

good to know

minor junco
#

yeah well that's a different thing

eternal oxide
#

then his answer is, to use a repeating task

minor junco
#

^ this

rapid vigil
minor junco
# rapid vigil yeah, some GUI libraries have an `updateInventory` method that you could use in ...

Mine has that for example, you can define the interval

    CustomInventoryBuilder.builder()
        .title("Teleport inventory")
        // we update the inventory every second
        .interval(TickDuration.ofOne(TickTimeUnit.SECONDS))
        .populate(InventoryStoragePopulator.create()
            .fill(Material.GRAY_STAINED_GLASS_PANE)
            .outline(Material.RED_STAINED_GLASS_PANE)
            .set(InventoryPosition.ofPoint(4, 1), (accessor) -> accessor.getUpdateTicker().getElapsed() % 2 == 0 ? Material.REDSTONE : Material.EMERALD, (item, event) -> {
              event.getWhoClicked().sendMessage(ChatColor.AQUA + "You clicked the redstone or emerald!");
            })
            .getView())
        .build(plugin)
        .show(player);
#

This shows alternates between being a redstone and an emerald every second

minor junco
#

Thanks

#

Although this is the not yet finished version, and it's been sometime, you may have to return an ItemStack still

#

Not just a material

rapid vigil
minor junco
#

You can also have like layers, and multiple pagination and shit (already in the current version) just have a look in the readme

junior anvil
#

anyone here has any idea on how to make a flying mob that can melee attack?

minor junco
echo basalt
#

look at vex

minor junco
#

@rapid vigil

junior anvil
#

lmao

icy beacon
young knoll
#

No default methods allowed in bukkit :c

eternal night
#

pretty sure I already discussed this on paper, having this on block is pretty useless

young knoll
#

Also you scuffed the formatting of the Block class

eternal night
#

RegionAcessor or World makes a lot more sense

lost matrix
young knoll
#

That's up to MD :p

eternal night
#

otherwise you are going to limit yourself for 0 gain to a floored centre value

lost matrix
eternal night
#

I agree tho, default methods that do this heavy lifting in the API seem rather meh

young knoll
#

I do like the strategy stuff tho

eternal night
#

I mean

#

its the common spigot issue of "oh lets shit class types into the API"

#

I'd argue go for an adventure style of package local impl and then static constructor methods

#

otherwise, you need to be locking these types down heavily so no one does dumb shit with them

#

Or service provider them

#

tho, neither are the true and tried spigot way I guess ™️

lost matrix
eternal night
#

probably not even the worst idea honestly

lost matrix
#

sigh

young knoll
#

Yes I only make the best code

eternal night
#

I mean, in the end, a glorified service provider

young knoll
#

Example:

eternal night
#

but better than having public classes in the API

lost matrix
#

I mean... Registry sounds like an idea. But i see how all of those classes add nothing to the actual API, so it makes sense to hide them somewhere.

eternal night
#

Beyond that, unsure if this could nicely be moved onto the ChunkSnapshot

#

or well

#

some parent type

#

Heavy collection operations like this on the main thread sound annoying

#

especially if you are going to filter shit

#

FAWE moments

young knoll
#

*That ugly stream was meant to be temporary for testing but it does work so... uwu *

lost matrix
#

Since it doesnt directly use Blocks, it should be possible to find a common use point for RegionAccessor and ChunkSnapshot

young knoll
#

How would it work with snapshot if it goes outside the snapshot tho

eternal night
#

You die

young knoll
#

RegionSnapshot incoming

eternal night
#

idk, I mean, I am unsure how useful the predicate in the method for the block is too tbh

#

It doesn't prevent you from any of the heavy lifting that is World#getBlockAt

#

you already allocate the array list to the full size

#

I guess its API sugar for people that don't want to then filter?

lost matrix
#

Was trying to add this for consistency with getNearbyEntities

eternal night
#

I mean, given how completely different it functions from that method I doubt that is really needed kekwhyper

#

getNearbyEntities actually has a usage as the server can heavily optimise it

#

this is just syntax sugar for some basic math

#

which is nice, don't get me wrong

lost matrix
#

No, makes sense

#

So:

  • Hide implementations (possibly in Registry)
  • Move up to World or RegionAccessor
  • Move impl to CraftBukkit
  • Remove Predicate
  • Think about maybe finding a use in ChunkSnapshot
eternal night
#

(I'd probably not do a registry, iirc they are pretty close to minecraft things. Either do service provider or adventure style, iirc choco's scoreboard format PR also uses package local constructors for its impl)

#

this one ^

young knoll
#

Yeah the bukkit registries are meant to mirror minecraft ones

eternal night
#

one day component support will land in bukkit COPIUM

#

paper-api downfall

young knoll
#

Hopefully 1.20.5? MD+Choco plz

eternal night
lost matrix
#

So break into mojang and sneakily PR a registry for this. Got it.

eternal night
#

I'd be surprised, 1.20.5 is already going to be such a clusterfuck

young knoll
#

Shh you guys have mojang contacts right

#

Tell them not to break anything else

#

And tell them to add waterlogging to doors

eternal night
#

kekwhyper given that all of items are broken, I don#t think you could break more in a single development cycle

young knoll
#

Mojang I will, for free, add waterlogging to all the stuff missing it :c

young knoll
#

plz

eternal night
#

PepeSalute I'll leave a review after too for md, as realistically, those classes could be package private in their entirety

#

but yea

eternal night
young knoll
#

But not the heavy anvil!

lost matrix
#

But im not too sure about the static constructor methods...

eternal night
#

I mean, or shared accessor

#

your stuff is stateless anyway

#

Just like VoxelStrategy.edgyCollectionAlgo()

young knoll
#

Use the versions that take a Runnable

lost matrix
#

You pass a Runnable to it, or if you extended BukkitRunnable you use the method runTaskAsynchronously on BukkitRunnable

#

Which part?

#

Runnable is an interface in Java

#

Which class?

rapid vigil
lost matrix
#

You add nothing to this.
Your Task class either needs to implement Runnable or extend BukkitRunnable in which case you dont use the Scheduler but the
.runTaskAsynchronously() method on your class which extended BukkitRunnable

valid burrow
#

If we would assume every person here is incompetent it would be so much more pain helping people

#

„How do i set a lore“
„okay first if all let me explain to you what a object is…“ like imagine

rapid vigil
undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

rapid vigil
#

no one is following that unfortunately

valid burrow
#

we have this for a reason

vivid zodiac
#

Hi, i need help for something
I used hidePlayer(), but we can't hurt him
I have alternative ?

vivid zodiac
#

that show item in hand :/

rapid vigil
# valid burrow we have this for a reason

although its correct to assume that they know java basics because they mustnt get into the spigot api without knowing it. as i said 95% people dont follow that so you gotta keep that in mind when they dont understand what you're talking about

valid burrow
proud badge
#
        if(player.hasPermission("antiillegals.bypass")) {
            return;
        }
        if(item != null && item.getType() != Material.AIR) {
            if(AntiIllegals.getInstance().getIllegals().contains(item.getType())) {
                broadcastStaff("Illegal item "+item.getType()+" removed from player "+player.getName()+"'s inventory");
                inv.remove(item);
                player.sendMessage(MiniMessage.miniMessage().deserialize("<red>An illegal item has been changed/removed from your inventory"));
                return;
            }``` How come this doesnt remove the item if Inventory is a player's inventory and not a chest one?
valid burrow
#

nms ig

undone axleBOT
vivid zodiac
valid burrow
#

yh yh ik

#

lemme think

rapid vigil
valid burrow
#

but

#

there may be a better one

rapid vigil
#

theres probably a library for that you could use it to avoid NMS directly

valid burrow
#

dont do anything yet

#

i will do some research

#

what version are you on?

echo basalt
#

just invisibility effect?

vivid zodiac
#

a displayEntities follow the hiden player, can i add a Damage event on it ?

young knoll
#

You can do equipment with the api

rapid vigil
young knoll
#

sendEquipmentChange

valid burrow
valid burrow
echo basalt
#

Then yeah just make the entity invisible and send packets to fake the thing being empty

echo basalt
#

Or make an armorstand that follows the player's location and redirects clicks

#

which is probably the less nms hackery way

valid burrow
#

sounds way less efficient

rapid vigil
#

If you'd like to take a look at it

valid burrow
vivid zodiac
valid burrow
#

show me

#

just do

#

on entity damage entity event

echo basalt
#

entity.damage

valid burrow
#

show the error log and class

vivid zodiac
valid burrow
#

?paste

undone axleBOT
valid burrow
#

put the code in here

#

and then click save

#

and copy link

valid burrow
quaint mantle
#

Does anyone here specialize in bot attacks?
I need someone who can started attack over 10,000 bots per second on my server
This is a legit stress test for my own server 🤝
you can? dm me

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

vivid zodiac
valid burrow
vivid zodiac
#

extends ItemDisplay and implements EventHandler ?

valid burrow
#

the class shouldn’t implement ItemDisplay

vivid zodiac
#

can't find EventHanlder

valid burrow
#

missspelled

#

typ

#

typo

#

EventHandler

vivid zodiac
#

oh mb didnt saw..

valid burrow
#

wait no

#

im retarted rn

#

implement Listener

#

eventhandler is the @

rapid vigil
#

annotation :p

valid burrow
#

like u said

#

„dont assume people know java“

#

i followed ur advice

rapid vigil
valid burrow
#

pick a side already 😭

#

what do you want me to do now

rapid vigil
#

-_-

valid burrow
#

explain in propper or noob terms

vivid zodiac
valid burrow
#

only Listener

#

make sure to always use the Bukkit Listener and not some normal java class when importing

#

thats the case for everything obviously

#

common mistake

vivid zodiac
#

playerInfo.block = (hidenBlock) p.getWorld().spawn(loc, ItemDisplay.class);

Here i let the cast ?

#

cause always crashing :x

valid burrow
#

what is hidenBlock

#

You need to cast it to ItemDisplay

#

and what is playerInfo.block

#

im not really sure what you are trying to do there

#

ohhh its an abstact class

#

well

#

uh

#

are you sure you wanna do this?

#

i can tell you a million easier ways

vivid zodiac
#

rly ? idk Java warn me to do this 😂

valid burrow
#

xd

#

well what i would do is

#

have 1 class named InvisibilityManager

#

this class should implement Listener

#

1 static void: makePlayerInvisible(Player, durarion)

#

1 eventHandler onEntityDamageEntity

#

a static hashmap<player,int> to store the duration

#

i think thats it

vivid zodiac
#

Hm
And the fonction PlayerInivible give potionEffect ?

valid burrow
#

not needed

#

just do all that in makePlayerInvisible

#

u dont need a potion effext

#

@vivid zodiac

vivid zodiac
#

yh sry i was trying something.. probably better to cancel heldItem packet
how can i did it ?

dusk trench
#

Hi. Can anyone help me with fixing something in my plugin?

rapid vigil
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

dusk trench
#

I'm trying to make that if I place a specific chest it will drop me an item.

#

And it works but not when I hold more than one Item

twin venture
#

BlockPlaceEvent ?

dusk trench
#

yep

#

but When I'm holding more than 1 of this item it just places normally

vivid zodiac
#

show ur code

#

?paste

undone axleBOT
lost matrix
#

You are checking your custom chest with .equals() arent you

dusk trench
#

yes...

lost matrix
#

You should add a PDC tag to your ItemStacks to check for custom items.

#

?pdc

dusk trench
#

thst's my chest class

blazing ocean
#

please click format document in intellij

rapid vigil
dusk trench
#

I'm using idea 😛

icy beacon
#

It was, in fact, that bad

blazing ocean
rapid vigil
dusk trench
#

it should be more readable now

icy beacon
#
        ItemStack is;
        ItemMeta im;
        is = new ItemStack(Material.CHEST);
        im = is.getItemMeta();

No reason to split up declaration and assignment in your case

rapid vigil
#

?conventions

icy beacon
#

Player player = (((Player) sender).getPlayer()); The outermost parentheses do nothing here

#

if (command.getName().equalsIgnoreCase("premiumcase")) { This is redundant for commands, because they will only be executed with the name that you registered them with

#

giveitem should be giveItem (see conventiones Porey linked)

dusk trench
icy beacon
#

Also no reason for this method at all, just inline it

rapid vigil
cinder abyss
icy beacon
rapid vigil
icy beacon
#

Yes, it wouldn't work. But like... would this method even be called??

icy beacon
#

Then it should work

dusk trench
#

I mean command works no matter how i type it so...I think I'll leave it as it is, also thanks for your feedback I made that changes

#

but what about placing chests if I have more than 1 in stack?

icy beacon
#

Some more changes to do:

  • No need for your pcase() method, because you only use it locally. Inline it, OR BETTER YET:
  • Create an ItemStack and initialize it when PremiumCommand is initialized, then reuse it
rapid vigil
#

Also its recommended to use the label for checking the command name instead of command.getName(), because label will allow you to use aliases but command.getName() wont

dusk trench
icy beacon
#

Visiting your listener...

        Player p = (Player)event.getPlayer();
        String placer = (String)p.getName();
        Block b = (Block)event.getBlockPlaced();

Why are you doing this??? Casting Player to Player or String to String will do nothing and your IDE should be telling you about this

dusk trench
icy beacon
#

return; This statement is the last statement in your method, it's redundant

dusk trench
#

ok

icy beacon
dusk trench
icy beacon
#

new PremiumCommand().pcase();
Yeah.. no. If you are using pcase() globally in various places, move it somewhere like an ItemUtils class and make it static. It should NOT be residing in your PremiumCommand class, let alone be class-scoped instead of static in this case

icy beacon
#

static Main plugin;
If you don't reassign plugin somewhere like your onEnable to your actual plugin instance, this will do nothing. It's just a null variable. Perhaps you were trying to do dependency injection?

#

?di

undone axleBOT
dusk trench
dusk trench
icy beacon
#

You create a static variable static Main plugin and don't assign any value to it.

#

This will do nothing and, better yet, when you call plugin.anything() it will throw an exception, because plugin is not initialized.

#

I presume you were trying to do dependency injection, to which I've sent a link above

dusk trench
lost matrix
#

So your pcase() method should always create a completely new ItemStack with a custom tag on it.

dusk trench
#

no hard reference even if I'm only using it twice and I'll never use it again?
So I should create a custom tag instead and check if item has it?

lost matrix
#

Yes, your method should just create a completely new ItemStack every time.
And you should check if your ItemStack has a custom tag on it or not.

dusk trench
#

okay I understand

ocean hollow
#

how can I make sure that the message is not replaced, but the animation is played again as the message appears? I thought about doing this, but nothing has changed (I think the problem is that the code is executed in a split second, and it does not have time to execute 2 animations one by one).

#

("how are you" should have the same animation as "hi")

lost matrix
ocean hollow
#

okay, thanks

lost matrix
# ocean hollow okay, thanks

But the straight forward way would be to just .remove() the old TextDisplay if it exists, and simply spawn a new one.

dusk trench
lost matrix
#

Noice

#

If you are speaking about implementing the protocol, then i would say its labour intensive

#

The minecraft protocol simply builds on TCP over IP

#

Sure

deep herald
#

anyone know how to make custom biomes

shadow night
lost matrix
#

Minecraft uses IP on layer 3 (obsly) and TCP on layer 4

deep herald
lost matrix
#

Thats right. And the data frame of the TCP packet contains the custom data from minecraft.

#

And server/client send TCP packets to each other, interpreting and updating their state accordingly.

shadow night
#

damn, I'm, at this right moment, working with packets

deep herald
lost matrix
# deep herald .

Custom biomes are not something your can achieve with the API.
You need to register your custom BiomeBase implementations in the nms Biome Registry.

lost matrix
#

🙂 Yes skinny i am aware of their existence

#

Yes, its cool and necessary even.

lost matrix
# deep herald i mean with nms

There is quite a lot that goes into this. Mainly creating a new Biome through the registry and configuring it afterwards.
You might want to search for something online because nms is generally not supported.

vivid zodiac
# valid burrow xd

K' i used ProtocolLib and cancel Equipment paquets, and that's work, ty for help 🙂

proud badge
#

is there a difference between .runTask and .runTaskLater(delay: 1 tick)

lost matrix
#

No

eternal oxide
#

unless, it's run inside another task

lost matrix
#

Well, in some circumstances runTask might actually run right away

#

Yeah

pseudo hazel
#

who doesnt love a good ol nested runnable

young knoll
#

I don't think it will outside of that

#

Tasks are handled at the start of the tick

shadow night
#

are they? I thought they are handled at the end

vivid zodiac
#

Can i remove feet particles ?

rough ibex
#

Feet particles?

#

The footsteps?

kind hatch
#

Walking particles

rough ibex
#

oh

#

I think that's client-side

#

may be wrong

lost matrix
#

Feet particles kekw_hyper

rough ibex
#

I was thinking of the footstep square

#

that isn't used at all

vivid zodiac
rough ibex
#

huh

#

please clarify

calm lichen
#

hey so im working on making it so when players break an ore type block that ive defined, it turns the ore block into stone and then after a set amount of time it regenerates, but instead of turning it into stone it just made it drop stone 😂 if it's not block.set() what am i supposed to be using

worthy yarrow
#

You have to save the originial block state in order to restore it at a later period

vivid zodiac
worthy yarrow
#

Cosmic prisons had like 3 steps to this iirc, ore, stone, cobble, then it turned to a piece of bedrock for a while, so for each block state that isnt the original you'll run a timer in order to determine when the block should be returned to it's original type. @calm lichen

rough ibex
#

if player is running

calm lichen
#

2 sec ill just post the code

calm lichen
worthy yarrow
#

?paste

undone axleBOT
pallid oxide
#

i wonder how many % code minecraft with vscode

vivid zodiac
#

So.. need to cancel running packet

calm lichen
#

yes using paste

worthy yarrow
#

k coolio

shadow night
pallid oxide
#

i mean it has its purpose and users, but still, been using it for 2.5years for school and still i hate it:D

calm lichen
shadow night
plush sluice
#

what the hell is going on, it was working and suddenly its not working

worthy yarrow
# calm lichen Main Class: https://paste.md-5.net/xalulifuwo.java MiningListener: https://paste...

So as far as I can tell, it looks pretty good. I'd however, implement different "states" of blocks that you're tracking ie: ore, block, stone, or wtv your cases are. Depending on the state of the block is how you should handle the actions. For each block in minedOres should be checked against the original state + it's timer. I feel like this system will make your plugin easily expandable / 2x as maintainable.

#

The issue that you're having is uh

calm lichen
#

thanks for the advice, i'll look into implementing that as soon as i figure out how to actually get the ore to turn into stone rather than just dropping stone when its mined

worthy yarrow
#

Well I'm still trying to find it

calm lichen
#

yea im lost 😂

#

take ur time im in no rush, im in it for the long haul on this project as its more of a personal thing that i want to do anyways

worthy yarrow
#
@EventHandler
    public void onBlockBreak(BlockBreakEvent event) {
        Block block = event.getBlock();
        if (block.getType() == Material.STONE && minedOres.containsKey(block.getLocation())) {
            // Cancel the block break event
            event.setCancelled(true);
        }
    }```

If anything I think it'd be handled here...
#

Er

#

I think it's the other one actually, the other blockbreak listener

worthy yarrow
#

Pretty sure that's your fix

calm lichen
#

im slow in the head

#

thank you

worthy yarrow
calm lichen
#

😂 i just need another set of eyes whenever i work on something I swear, thank you so much

plush sluice
blazing ocean
#

youre using bukkit chatcolors

worthy yarrow
#

^ easy fix

#

just redo the import

plush sluice
#

?

blazing ocean
#

still

worthy yarrow
#

That doesn't matter

blazing ocean
#

bukkit chatcolors are diff to bungee chatcolors

#

even on bukkit

#

no idea why that is the case tho

worthy yarrow
#

BungeeCord is a bukkit plugin too but it offers a different chatcolor import as they use a different system iirc

plush sluice
#

lemme check it another time if that is it then bruh

blazing ocean
plush sluice
#

i was looking for it thru all code

worthy yarrow
#

I wan't to say different system... it's the same implementation as the reg bukkit import but I'm pretty sure their colors are handled differently

plush sluice
#

it was giving me these errors

#

ima compile it now and check

worthy yarrow
#

mmmm

blazing ocean
#

ChatColor.of("#123456") is a thing

twin venture
#

where i can find the entity_metadata for 1.8.8 , and for all versions?

#

packets ?

blazing ocean
#

?1.8

undone axleBOT
plush sluice
twin venture
blazing ocean
#

youre not gonna receive support for that

orchid trout
#

^

#

not here atleast

twin venture
#

then where i can find for version 1.16.5 ?

buoyant musk
#

why does this say go away

#

i just wanna put my worlds into a folder

inner mulch
#

rmap instance?

#

i dont have it tho.

#

do you know what redis is?

#

basically, its a map that exists in redis, which is a distributed cache

#

its a map to cache java objects across an entire proxy :)

short pilot
#

Intellectuals, i require your help once again

#

how can you get generic attack damage attribute from an entity? (1.19.2)

young knoll
#

Should just be getAttribute(Attribute.GENERIC_ATTACK_DAMAGE)

sterile token
#

Hii, how are you? Let say you are designing a minigame based on custom items. Would you all the time look for the item details in the items section at the config? Or you will load each section item on plugin start to then compare the object itself?

young knoll
#

Load on start

#

Just give every item a unique id of some sort in pdc and then use that as a map key

sterile token
# young knoll Load on start

I thank you Col. because I did it before in another plugin and I was branded as bad practice. And not only that, they said that the method I did was inefficient 💀

#

because their argument was so simply as "you are creating innecesary objects" which takes memory 💀 💀 💀

young knoll
#

Imagine if hypixel skyblock loaded items from its database on demand

sterile token
#

wait

#

i think i miss understand

#

im not sure if you understand what i meant

#

I mean something more like this, where I have a plugin where everything is based on custom items that are added in a configuration. And then they are used in the game. What would you do?

a) You would find it directly through the config.
b) Load each item from config to an object when you start the plugin, and then compare them against the in-game one.

alpine urchin
#

Due to the issues that come with shading. The unnecessary additional processing when multiple instances of packetevents are present on the server. The fact that you would need to relocate if you want to ensure no errors with other instances of packetevents that might be running on a different version. It is more difficult to override packetevents behavior from an external plugin since there are multiple instances. But we might say that providing the option to shade was one of our "selling" points during our come up and helped us grow as a project since developers like to use dependency-free as a selling point for their projects. Years later we reflected and realized that shading comes with some negatives.

blazing ocean
#

shading is still cool

#

especially when you dont use other plugins

alpine urchin
#

it's kind of like gatekeeping the library

#

i want to get some downloads too :c

twin venture
#

hi iam using protocollib , i just have a question about something

young knoll
#

Well you should make a TinyProtocol type thing

#

TinyEvents

twin venture
#

23, EntityDataTypes.ITEMSTACK, SpigotConversionUtil.fromBukkitItemStack(getSkull()));

the first thing is index , where i can specfiy the slot of the itemstack?

chrome beacon
#

NanoEvents

chrome beacon
#

also is index the id of the packet or just the slot

twin venture
#

that's what iam asking ..

#

i got name working

#

and invisiablty

#

now i only needto make it equip a custom item

#

iam using EntityLib [its a library that should support all ver but it does not throw its api , i need to set index of old versions [i dont mind as long as i get it working.]

chrome beacon
#

You're probably better of just using ProtocolLib directly

twin venture
#

i must make a moudle system for it if i want to support 1.8 -> 1.20.4 [only 2 versions]

chrome beacon
#

yeah

blazing ocean
#

the one from tofaa

wintry lynx
#

Sooooo. Does anyone know the best way to run a BukkitRunnable a certian amount of times?

chrome beacon
#

?scheduling

undone axleBOT
alpine urchin
wintry lynx
#

I cant change variables within the task so I cant do traditional loop stuff

alpine urchin
#

:)

chrome beacon
#

It's all about how you setup the task

wintry lynx
#

-.-

worldly ingot
#

idek what you would need to have add-ons for in a library PES2_HmmmmNoted

chrome beacon
#

so have a counter

#

that counts every time it runs

wintry lynx
chrome beacon
#

Sounds like you did it wrong

#

You probably have the count outside of the runnable

alpine urchin
wintry lynx
chrome beacon
#

It can be in the runnable but outside of the run method

young knoll
#

Make a custom class for it

chrome beacon
#

^^

young knoll
#

And have the counter as a an instance variable

wintry lynx
young knoll
#

(BukkitRunnable is something you are allowed to extend)

wintry lynx
rapid vigil
#

You could reset it when it hits 0

wintry lynx
alpine urchin
wintry lynx
#

I just did that

rapid vigil
alpine urchin
#

cause not everyone uses entitylib

wintry lynx
#

"i" being the loop number

rapid vigil
#

I meant

if(i == 0) {
  i = 5;
  cancel();
} else {
  i--;
}```
young knoll
#

No need to reset it when using a custom class

#

You just make a new instance

rapid vigil
#

Oh i just assumed he will have 1 instance

#

then nvm xd

wintry lynx
#

So no cancel needed

#

Or restart i mean

twin venture
#

you know how to use it?

alpine urchin
#

read what i said

timid hedge
#

Does anyone know why my worldgaurd depdency dosent work?

        <dependency>
            <groupId>com.sk89q.worldguard</groupId>
            <artifactId>worldguard-bukkit</artifactId>
            <version>7.0.0</version>
            <scope>provided</scope>
        </dependency>
org.bstats:bstats-bukkit:jar:1.4 was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced

Try to run Maven import with -U flag (force update snapshots)

blazing ocean
#

looks like you dont have the repo

#

ah damn it

timid hedge
#
        <repository>
            <id>sk89q-repo</id>
            <url>https://maven.enginehub.org/repo/</url>
        </repository>
#

Isnt this the right one?

agile hollow
#

how can i make the reload command for the plugin like /spigotmc reload and it reload my plugin?

blazing ocean
agile hollow
tender shard
blazing ocean
#

issues with other plugins

#

tl;dr: set up a dev environment or restart

#

hotswapping is painful so just stick to restarting

chrome beacon
#

if you're using the builtin getConfig you can use the reloadConfig method

blazing ocean
#

well theyre wanting it to reload the entire plugin

#

not just the config

echo basalt
#

I wonder if I can make a custom world manager plugin 🤔

#

and bypass nms entirely

chrome beacon
#

I don't think that's the case

echo basalt
#

and do all the packet hackery myself

timid hedge
echo basalt
#

actually entities are a thing hm

blazing ocean
tender shard
agile hollow
tender shard
#

it should then output some tree-like text thingy, ?paste that

timid hedge
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

timid hedge
tender shard
#

why don't you just upload the text output

#

?paste

undone axleBOT
timid hedge
#

Ohh

tender shard
#

that's not the full output

timid hedge
#

it is?

tender shard
#

no

timid hedge
#

I took everything from there and copyed

tender shard
#

did you select the root entry next to the console before copy/pasting?

#

anyway, then just ?paste your whole pom.xml

tender shard
#

you need to exclude bstats-bukkit from worldguard, alternatively update worldguard

#

however 7.0.0 won't work with 1.8.8 anyway

timid hedge
timid hedge
tender shard
#
        <dependency>
            <groupId>com.sk89q.worldguard</groupId>
            <artifactId>worldguard-bukkit</artifactId>
            <version>7.0.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion> 
                    <groupId>org.bstats</groupId>
                    <artifactId>bstats-bukkit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
#

but for 1.8.8 you need an ancient worldguard version, probably 6.something

timid hedge
#

6.0 or 6.0.0 do you know that?

tender shard
#

probably latest 6.X

timid hedge
#

Seems to work with 7.0.0

tender shard
#

doubt it

#

WG 7 is 1.13+

#

you'll need worldguard 6

tender shard
timid hedge
# tender shard try this version

Im getting this error when im trying:

Could not find artifact com.sk89q.worldguard:worldguard-bukkit:pom:6.1 in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
Could not find artifact com.sk89q.worldguard:worldguard-bukkit:pom:6.1 in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)

tender shard
timid hedge
#

i am using 6.1

tender shard
#

wrong artifact id, wrong group id

timid hedge
#

Oh sorry, didnt see that

#

Do you know why everytime i reload maven (the reload button or what its called) all my libraries i have manual added are being disabled?

tender shard
#

wdym with "manually added"?

timid hedge
#

Adding them though project structure under "libraries" on the "+" button

tender shard
#

that will not work

#

you have to add them using maven

timid hedge
#

Its not a public plugin

tender shard
#

doesnt matter

#

you have to add them using your pom.xml if you're using maven to compile

#

if the dependency is itself a maven project: run mvn install on that dependency, then you can add it to your pom.xml on the other project.

if the other project is not a maven project: https://blog.jeff-media.com/manually-installing-jar-files-to-your-local-maven-repository/

Sometimes you have a certain .jar file that you need as dependency, but the author of that .jar was too lazy to properly upload it to a public repository. That’s bad, but not a problem. There are two ways to solve this, but only one proper way. The proper way: install the dependency The proper...

timid hedge
#

It is a maven project, but i dont know how i run maven install on it

tender shard
#

after you did that, you can just add it using the groupid and artifactid in the pom of your other project

timid hedge
#

I dont own the plugin, its my friend who made it

#

But i have the src if it matters

tender shard
#

yeah then run mvn install on the project

timid hedge
#

I dont have the project

tender shard
#

you said you have the source?

timid hedge
#

I have the source in a src.rar file

tender shard
#

and that does not include a pom.xml ?

timid hedge
#

The source that i have dosent but the plugin does
He sent me the "src" folder that he had in his idea projects

#

But i can get the pom.xml

tender shard
#

pretty weird way to share a project lol

#

but you do have a .jar file for that friend's project right?

timid hedge
#

Yea

tender shard
#

Sometimes you have a certain .jar file that you need as dependency, but the author of that .jar was too lazy to properly upload it to a public repository. That’s bad, but not a problem. There are two ways to solve this, but only one proper way. The proper way: install the dependency The proper...

timid hedge
#

Alright its working now, thanks alot for the help

tender shard
#

np

quiet ice
#

Or use file:// repos in relation to the project's working dir, a practice I personally prefer

wintry lynx
#

I changed from a BukkitRunnable to a Runnable for reasons. Now I cant cancel it :I
Did I mention I bad with runnables.

#

And I cant just do task -> for other reasons

#

So im not sure what to do here

eternal oxide
#

Use a BukkitRunnable if you want to cancel from inside

wintry lynx
worthy yarrow
#

Why?

eternal oxide
#

I don;t believe you

wintry lynx
#

For one its depreciated.
And Two:

#

I have to use the new version, aka the one that uses Runnable instead of BukkitRunnable

eternal oxide
#

no

wintry lynx
eternal oxide
worthy yarrow
eternal oxide
#

Its literally telling you to use BukkitRunnable