#help-development

1 messages · Page 435 of 1

wet breach
#

As for the client packs can be textures or other modifications. They are like a hybrid form of mod

young knoll
#

Packs is probably referring to the experimental 1.20 datapack

hasty pebble
#

Okay so how do I get other versions if 1.19 won't work

wet breach
#

Wiki page for buildtools tells you how

indigo frost
#

I cant find it in the functions list for an entity

hasty pebble
#

I figured it out

young knoll
#

Iirc it’s on LivingEntity but it might be in Mob

delicate lynx
#

it's on LivingEntity yes

bold vessel
#

Why i have this error
bukkit.configuration.ConfigurationSection cannot be converted to java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>>
https://paste.md-5.net/inasoyasas.java

delicate lynx
#

what line

bold vessel
#

33

young knoll
#

Because a configuration section is not a map

delicate lynx
#

getConfigurationSection returns a ConfigurationSection

bold vessel
#

What should i do ?

young knoll
#

Store it as a ConfigurationSection

bold vessel
#

so its only the config.yml ?

young knoll
#

What

bold vessel
#

wdym by store it as configuration section ?

young knoll
#

A variable with type ConfigurationSection

bold vessel
#

Like this ?

young knoll
#

Mhm

wet breach
#

Add dashes just before factions or the coords depending which one you want to be mapped

#

Otherwise those are both lists or factions ones can be considered sections

untold stirrup
# bold vessel Why i have this error `bukkit.configuration.ConfigurationSection cannot be conve...

In this updated code, we first create a new HashMap object for the Map we want to populate. We then extract the ConfigurationSection object from the main configuration object and loop through its keys. For each key, we extract the ConfigurationSection object for that key and loop through its keys to extract the values and add them to a new HashMap. Finally, we add the sub-Map to the main Map with its key !

#

example :

#

public void exampleMethod(ConfigurationSection config) {
    // Assume that config contains a section named "mySection"

    Map<String, Map<String, Integer>> myMap = new HashMap<>();
    ConfigurationSection mySection = config.getConfigurationSection("mySection");

    if (mySection != null) {
        for (String key : mySection.getKeys(false)) {
            ConfigurationSection subSection = mySection.getConfigurationSection(key);

            if (subSection != null) {
                Map<String, Integer> subMap = new HashMap<>();

                for (String subKey : subSection.getKeys(false)) {
                    int value = subSection.getInt(subKey);
                    subMap.put(subKey, value);
                }

                myMap.put(key, subMap);
            }
        }
    }
}```
#

Here is an updated version of the code that should avoid the error

hasty pebble
#

Okay so I did the things but spigot is having issues with Java for some reason it keeps saying there was an exception

indigo frost
ancient island
#

does setLazer not exist or am I just dumb

buoyant viper
#

is it Laser instead of Lazer

sullen marlin
#

getPlayer(s) and compare address

icy beacon
#

i guess you could get all offline players, aka everyone who ever played on the server

#

nvm OfflinePlayer does not have an address field

sullen marlin
#

Won't work offline

#

You would need to log ips into a database

hazy parrot
tender shard
#

btw for ipv6 you shouldnt just compare the single IP but rather the whole /64 subnet

#

basically every provider assigns /64 subnets for ipv6 sooo every user has about 18 quintillion IPv6 addresses

sullen canyon
#

its the same as connecting spigot plugin to a db

#

basically no difference

tender shard
#

it's not harder nor easier than using a database in any other application

eternal oxide
#

just Bungee I'd use a simple in memory Map to yaml

tender shard
#

wdym?

eternal oxide
#

saving IP's would subject you to GDPR compliance

tender shard
#

it doesn't matter though whether you save it to a file or to a mysql db

eternal oxide
#

yep ^

tender shard
#

well it's no difference. if you save personal related data of EU citizens, you gotta do it accordingly to GDPR. but whether you save it to a file or into a mysql db, or whether you write them down by hand, is no difference

#

yes

wet breach
#

Since ip addresses are not always unique to a given user and it doesnt personally identify them then it isnt subject to gdpr

untold stirrup
eternal oxide
wet breach
#

If it was combined with additional data to identify them then yes

eternal oxide
#

BlackBeltBarister on YT covered it a few times.

wet breach
#

Or any server for that matter

tender shard
#

in recital 30, the GDPR explicitly mentions ip addresses

eternal oxide
#

IE data requests

untold stirrup
#

IP address, it can be difficult to distinguish between different users
In cases like this, it may be necessary to use additional methods to authenticate and verify the identity of users, such as requiring users to log in with unique usernames and passwords, or using two-factor authentication (2FA) methods such as SMS codes or app-based authenticators !

wet breach
#

I dont have to remove them if someone requests it

eternal oxide
#

no

wet breach
#

Nor do i have to provide what was logged either

eternal oxide
#

but you have to provide any data you hold if they request it

wet breach
eternal oxide
#

lol you still on this? I'm only repeating what a Barrister told me. I'd rather trust the Barrister.

wet breach
#

So lets say you record ip addresses for security related reasons. Which is the most common reason for logging ips i do not have to give the data held on that and only have to inform that any data in regards to the ip is for security related reasons.

wet breach
humble tulip
#

Should what i posted on #general be here?

#

I'm not sure where it should've been posted

eternal oxide
#

When it comes to Law I'd rather trust the person qualified to decipher it.

wet breach
#

Dont care if they are a lawyer. Lawyer doesnt mean ability to interpret any more then common person at least in the US because the only entities legally allowed to interpret officially are judges. Everyone else has to take what it means at face value

tender shard
eternal oxide
wet breach
#

Well guess i dont have that problem or worry

icy beacon
#

can someone help me figure out this json error? i'm trying to serialize a class into a json file, but i'm getting an error that doesn't seem to be happening because of me: https://paste.md-5.net/uvadovobep.cs
serialization code: https://paste.md-5.net/muzalelize.m
KingdomsPlugin.kt:48 is just me calling gson.toJson:

val kingdomsFile = dataFolder.resolve("kingdoms.json")
FileUtils.writeStringToFile(kingdomsFile, gson.toJson(kingdomManager), StandardCharsets.UTF_8) // commons-io
#

i've looked it up and none of the results were exactly relevant, i tried doing this in my maven-compiler plugin and it did not help:

                    <compilerArgs>
                        <arg>--add-opens java.base/java.lang=ALL-UNNAMED</arg>
                        <arg>--add-opens java.base/java.nio=ALL-UNNAMED</arg>
                        <arg>--add-opens java.base/sun.nio.ch=ALL-UNNAMED</arg>
                        <arg>--add-opens java.base/java.util=ALL-UNNAMED</arg>
                    </compilerArgs>
humble tulip
#

Why are you serializing your kingdom mamager?

icy beacon
#

good point. well, KingdomManager looks like this:

package com.roughlyunderscore.kingdoms.manager
// imports

class KingdomManager {
  val kingdoms = mutableListOf<Kingdom>()
  // util methods omitted
}

so it's just convenient for me to have a wrapper class instead of just having a list. however you bring up a good point, do you think i should just serialize the list?

humble tulip
#

Ah yk what's happening i think

#

Gson doesn't know to use your serializer @icy beacon

icy beacon
#

why not?

humble tulip
#

How did you tell gson that that class serializes kingdom manager?

icy beacon
#

i've registered it btw

#

one sec

#
private fun initJSON() {
    gson = GsonBuilder()
      .setPrettyPrinting()
      .registerTypeAdapter(Values::class.java, ConfigurationDeserializer())
      .registerTypeAdapter(KingdomManager::class.java, KingdomDeserializer())
      .registerTypeAdapter(KingdomManager::class.java, KingdomDeserializer())
      .create()
  }
#

oh fuck

#

did i really do this

#

:wheeze:

humble tulip
#

Gson will handle the list itself

icy beacon
#

instead of registering KingdomDeserializer and KingdomSerializer

humble tulip
#

Lmfaoo

icy beacon
#

yeah...

#

i'll try it now and see if the hotfix works

#

yeah it works now

#

lmfao

#

thanks minion

#

i probably wouldn't have gone to the initializer to double-check without you

wispy wyvern
#

can i have a menu gui, like a enderchest gui example, and open it on block place?

#

basically i want to call an already made menu, in another class

#

can i do that?

humble tulip
#

You wanna open echest?

#

Yes

wispy wyvern
#

without a command

#

instead of doing /echest or something, i want to call it

terse ore
#

when do you want to call it'

wispy wyvern
#

so whenever i want, i want to call the class to open the menu

humble tulip
#

Player.openInventory(player.getEnderchest);

wispy wyvern
#

oh

#

but lets say it's a custom menu

#

for example a lobby selector

tall dragon
#

enderchest is just a 3 row chest with a fancy name

terse ore
#

then why you need an ender

tall dragon
#

so then u can just open a normal chest menu

wispy wyvern
terse ore
#

okok

wispy wyvern
#

i have a command that opens my menu

#

and i can call the command and it opens the menu

#

but i wanted it to open without forcing the player to execute the command

terse ore
#

but the thing is

#

when do you want it to be called

wispy wyvern
#

when i place a block

#

specific block, but that i can do

terse ore
#

then I would recommend making a method or class with the inventory

#

that opens the inventory for the player

#

and call it when the command is executed or the block is placed

wispy wyvern
#

so this is my menu command

#

can i utilize what's in there?

humble tulip
#

Yes

#

Not the best way to do it but you're learning

quaint mantle
#

Pass the instance to another class

#

To use it

lost matrix
#

?di

undone axleBOT
wispy wyvern
#

i thought about using it as a component

#

then i just call it and it's the menu basically

lost matrix
#

The optimal way requires a bit more java knowledge.
Just a heads up: You should not check for custom names on anything.
Not on custom inventories, not on custom items and not on custom mobs etc.

wispy wyvern
#

i was following a tutorial when i made that

#

should i not do that, like ever?

lost matrix
#

Yes

#

Very bad practice.

#

Tutorial was probably >5 years old

wispy wyvern
#

lets say i have 2 commands to open different menus

#

would they not mess each other?

#

if you dont check the name

wispy wyvern
lost matrix
#

Ofc you still need to check for identity.

#

If the inventories never change and every player has the same inventory, then
you can simply create the Inventory once and check with .equals() on it.
If you have several inventories then you would create a Set<Inventory>, add the
inventories when you open them, remove them when they are being closed and
check with .contains(inventory) if you need to check the identity.

lost matrix
wispy wyvern
#

i think i'll only use one menu

#

so no need to check any identity?

#

i mean, check custom name

lost matrix
#

You always need to check the identity or else you will mess up every chest, dropper, villager etc
on the server.

wispy wyvern
#

in my case, instead of custom name, how would i check its identity?

lost matrix
#

You create the Inventory once and then check with .equals() if the clicked inventory is the one you have instantiated

wispy wyvern
#

can you show me an example?

lost matrix
#

Sure

humble tulip
#

Create the gui in your main class

#

Create a getter

#

And then when the inventory is clicked, you can do plugin.getGUI.equals(event.getClickedInventory)

#

?di

undone axleBOT
humble tulip
#

Use dependency injection to pass instances of your plugin to your listener

#

You'll have to initialize the gui(add the items to it) in the onEnable method

lost matrix
# wispy wyvern can you show me an example?
public class MenuManager {

  private final Inventory someCustomInventory;

  public MenuManager() {
    this.someCustomInventory = Bukkit.createInventory(null, 3 * 9, "Coll Inventory");
  }

  public boolean isCustomInventory(Inventory inventory) {
    return this.someCustomInventory.equals(inventory);
  }

  public void openFor(Player player) {
    player.openInventory(someCustomInventory);
  }

}
public final class SpigotSandbox extends JavaPlugin {

  private MenuManager menuManager;

  @Override
  public void onEnable() {
    this.menuManager = new MenuManager();

    // Inject the manager into your listener
    MenuListener menuListener = new MenuListener(menuManager);
    Bukkit.getPluginManager().registerEvents(menuListener, this);

    // Inject the manager into your command
    MenuCommand menuCommand = new MenuCommand(menuManager);
    Bukkit.getPluginCommand("menu").register(menuCommand);
  }

}
#

Its always advisable to create manager classes.
Those classes are singletons, which means they are only instantiated once
and then this instance is passed around.

wispy wyvern
#

so a manager can be called whenever i want?

#

in different classes?

lost matrix
#

Everything can be called whenever you want

lost matrix
# wispy wyvern in different classes?

You can only use a class if you have an instance of that class.
A class is just a blueprint. It doesnt actually exist until you create an instance of that class.
And every instance has its own values which are independent from the other instances of that class.

humble tulip
#

You don't need a manager for a single inventory

#

However, with multiple inventories, amanager becomes useful as it removes clutter from your main class

wispy wyvern
#

ok

humble tulip
#

?di

undone axleBOT
humble tulip
#

Have a read of this page^^

lost matrix
#

Honestly even for a single inventory i would create a manager. Having a dangling inventory
somewhere just isnt clean. Doesnt matter where you put it, it would violate SOLID

terse ore
#

SOLID?

humble tulip
humble tulip
hybrid spoke
#

?solid

#

when command

wispy wyvern
#

plugin development is hard

#

jesus

#

props to you guys

humble tulip
#

Most Yt tutorials suck for plugon development

wispy wyvern
#

its good to get started and do simple plugins

#

but then you get lost in the amount of knowledge you need

hybrid spoke
#

you're lucky that you start in the age of chatAI

#

we didnt had that

wispy wyvern
#

i dont use that

hybrid spoke
#

use it

wispy wyvern
#

i like to struggle and learn the hard way

lost matrix
#

Most of it is just java. The rest of spigot follows the same pattern mostly.
All you need are events, commands and IO. The rest you have to imagine.

hybrid spoke
#

then close youtube and look up the docs

wispy wyvern
#

i dont use yt anymore, i used it to get started

humble tulip
#

Docs only become really useful when you know java

#

I feel like you know beginner java

hybrid spoke
#

i really doubt that

humble tulip
#

I'd say I'm intermediate

wispy wyvern
#

oh ok

#

then java that big huh?

hybrid spoke
#

i'm a noob

hybrid spoke
wispy wyvern
#

i am using java to make mobile apps, so idk

hybrid spoke
#

and if java itself isnt enough anymore you come to frameworks or other languages

wispy wyvern
#

am i that bad yet?

humble tulip
#

Yeah you think you know java

pseudo hazel
#

its not just about the programming language itself but about programming concepts in general

#

which go far beyond just learning java syntax

humble tulip
#

Then you decide to use a poorly documented framework and you feel like a beginner all over again

pseudo hazel
#

blame the framework then

wispy wyvern
#

ima stick to my js discord bots

hybrid spoke
#

challenge yourself and make a JDA bot

wispy wyvern
#

what is JDA?

hybrid spoke
#

java discord api

wispy wyvern
#

nahh

#

i barely know how to do them in js

#

and i use js more than java

hybrid spoke
#

thought you're an intermediate

wispy wyvern
#

my best bot, gave me roles 💀

wispy wyvern
#

proof?

pseudo hazel
#

minion said that

#

they should get a pfp

wispy wyvern
#

i also did xD, i removed it

#

soon as i realized it was not so simple to know java

#

i'll come back one day

#

dont miss me

hybrid spoke
#

au revoir

torn shuttle
#

the more I program on this keyboard the more I feel like I am a generic hacker in a cyberpunk story

echo basalt
#

weird fantasies but ok

young knoll
#

But are you as glitchy as a cyberpunk 2077 character

hybrid spoke
torn shuttle
young knoll
#

Do you feel like you might pass through a wall at any second

torn shuttle
#

I don't even see walls, I just see scrolling lines of green text written in japanese

tepid oar
#

I'm writing a plugin to add custom armors to my server and I was wondering how plugins like ItemsAdder go about setting a custom armor textures?

lost matrix
#

Ive tried tinkering with those but GLSL has a pretty steep learning curve and i havent had enough time for that yet

regal scaffold
#

Does PacketPlayOutChat not exist in 1.17.1?

#

What's the alternative

lost matrix
#

Use mojang mappings

regal scaffold
#

I am

#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>${spigotVersion}-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
            <classifier>remapped-mojang</classifier>
        </dependency>
tepid oar
lost matrix
regal scaffold
#

Ohhh gotcha

#

Wait, what mappings is PacketPlayOutChat from then?

regal scaffold
#

Ohhhhhhhh

#

Makes sense now

#

Should I always prefer mojang over spigot?

regal scaffold
lost matrix
regal scaffold
#

Actually that's a dumb questions cause mojand always has ClientBound at the start

#

lol

lost matrix
#

Yeah

regal scaffold
#

Can't seem to find ClientboundPlayerChatPacket

#

ClientboundChatPacket

#

Is the right one

#

Close tho, impressive hehehe

lost matrix
regal scaffold
#

And always prefer mojang mappings over spigot?

lost matrix
#

1.17.1 has not separation because the messages are not signed in this version

lost matrix
regal scaffold
#

Well but for old versions

lost matrix
#

If you have moj-mappings then always prefer them

quaint mantle
#

I am getting this error while installing BuildTools. (Spigot 1.8.8 and my java version is 1.8.0_361)

I am using the latest version of buildtools

Patching Block.java
Exception in thread "main" java.lang.RuntimeException: Error patching Block.java
    at org.spigotmc.builder.Builder.lambda$main$2(Builder.java:669)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.Iterator.forEachRemaining(Iterator.java:116)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
    at org.spigotmc.builder.Builder.main(Builder.java:620)
    at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
Caused by: difflib.PatchFailedException: Incorrect Chunk: the chunk content doesn't match the target
    at difflib.Chunk.verify(Chunk.java:86)
    at difflib.ChangeDelta.verify(ChangeDelta.java:78)
    at difflib.ChangeDelta.applyTo(ChangeDelta.java:44)
    at difflib.Patch.applyTo(Patch.java:43)
    at difflib.DiffUtils.patch(DiffUtils.java:70)
    at org.spigotmc.builder.Builder.lambda$main$2(Builder.java:657)
    ... 13 more
regal scaffold
#

Why can I not find the import using moj mappings

#

It just goes to md_5.bungee

lost matrix
#

Also

#

?1.8

undone axleBOT
quaint mantle
quaint mantle
lost matrix
quaint mantle
#

for example i close my smp server people were playing they were teleport to hub not disconnect the server how i can do this

regal scaffold
quaint mantle
quaint mantle
lost matrix
regal scaffold
#

Your picture reminds me of simon cowell

#

Until I zoom in

quaint mantle
lost matrix
#

Be very careful with this information.
What format is this? This doesnt look like json

torn shuttle
#

it's pseudo-json

lost matrix
#

Missing some colons for my taste

torn shuttle
#

pretty sure you can't enumerate like that in json

torn shuttle
lost matrix
#

Get the keys as a set and iterate them.
How are those values saved?

#
    // Some map
    Map<String, InetAddress> addressMap = new HashMap<>();

    // Serialize to json
    String json = gson.toJson(addressMap);

    // For generics you need a type token
    Type token = new TypeToken<Map<String, InetAddress>>() {}.getType();

    // Deserialize from json to object again
    Map<String, InetAddress> deserialisedMap = gson.fromJson(json, token);
#

That sentence makes no sense. I dont know what "a data with player name" is.

#

What do you mean by "this"

cedar dagger
#

Hello. I’m looking for a plugin for my smp server that has teams but also has the value of that team in the land that they have claimed please help me! thanks!

lost matrix
#

This doesnt take anything. Its an example on how to use Gson properly.
here is another example for non-generic classes:

    // Some map
    SomeCoolObject someObj = new SomeCoolObject();

    // Serialize to json
    String json = gson.toJson(someObj);

    // Deserialize from json to object again
    SomeCoolObject deserialisedObj = gson.fromJson(json, SomeCoolObject.class);
lost matrix
#

Also:

        Map<String, String> data = playerStrData.get(player.getName());
        if (data == null){
            data = new HashMap<>();
            playerStrData.put(player.getName(), data);
        }
        data.put(propertyName, value);
        saveDataFile();

Can be shortened to

  Map<String, String> propertyMap = playerStrData.computeIfAbsent(player.getName(), key -> new HashMap<>());
  protperyMap.put(propertyName, value);
  saveDataFile();
#

computeIfAbsent gets a value if present. If absent then a new value is put in the map and returned.

#

Its a lambda expression.
You can think of it like a function that you can pass around.
In this case its a function which creates a Map. This function is
used to create a Map if its not present.

#

Your approach is fine. If lambdas are a bit much right now then stay away from them.

regal scaffold
#

Smile were you able to look at my message above?

lost matrix
#

That i look like simon cowell?

regal scaffold
#

before

#

The import is like, not found while using mojang mappings

lost matrix
#

bungee has nothing to do with minecraft really.
What are you searching for.

regal scaffold
#

I want to convert ChatSerializer

#

Which is spigot mapping

#

To Mojang mapping

#

Ignore ignore

#

I can't even appear to read

#

Inner class

lost matrix
#

Yeah

#

🤷

#

Looks identical. Need more code.

rotund ravine
zealous osprey
#

Is the BlockExplodeEvent when the block itself explodes or when blocks are exploded via an explosion?
Aka. Is the event triggered for TNT exploding or blocks exploding cause of TNT?

rotund ravine
#

Neither

lost matrix
zealous osprey
#

beds?

lost matrix
#

Place a bed in the nether

#

Or the end

#

And youll see

zealous osprey
#

Really, that event is just for "intentional game design"

rotund ravine
#

?jd-s

undone axleBOT
zealous osprey
#

Was looking at this comment here

rotund ravine
#

Yes a block

lost matrix
# quaint mantle .

Are you positive that you downloaded the latest buildtools?
Also show your cli which you use to run buildtools.

#

Could be anything. My guess is that you are overwriting the file.

rotund ravine
zealous osprey
#

kk, thx

soft flame
#

its basically an anonymous function where you dont need to create another "public void methodName..."

hazy parrot
#

Anonymous class to be precise

quaint mantle
#

some files are loading in the installation, it gives an error here.

lost matrix
quaint mantle
#

Can you post the log file if you want?

lost matrix
#

Meh

night verge
#

I am wondering is there any way to cancel a feeding animal event?

lost matrix
#

Then cancel

young knoll
#

Use the normal PlayerInteractEntityEvent

lost matrix
#

Yeah makes sense

echo basalt
#

InteractAtEntity is exclusive for armorstands iirc

night verge
#

Is there any difference between PlayerInteractAtEntityEvent and PlayerInteractEntityEvent?

echo basalt
#

pain in the ass but mojang sends separate packets for some reason

night verge
#

I see. thx

lost matrix
#

AtEntity includes the vector which the entity was clicked at

icy beacon
#

how would i go about disallowing beds & anchors from changing a player's spawn location? google hasn't been exactly helpful

earnest wasp
#

Hello I need help for create plugin 1.19 please in eclipse!

icy beacon
earnest wasp
icy beacon
#

?learnjava

undone axleBOT
lost matrix
icy beacon
lost matrix
icy beacon
#

perhaps that's an option

#

shame spigot does not have a PlayerSetSpawnEvent

#

not in the mood for coding in paper lmao

crimson terrace
#

wouldnt that just be any time a player right clicks a bed?

icy beacon
#

and an anchor

crimson terrace
#

and a command/other plugins setting it

icy beacon
#

yeah

crimson terrace
#

for the right click ways its pretty easy to simulate that event tho

icy beacon
#

i don't wanna make an event

#

too lazy for that as well

#

will just redirect the spawning

night verge
#

I want to create a custom mob with its own texture.
But I came across a problem when I was trying to modify its animation.
I don't know how to control its body parts(eg:head, left hand, right hand, left leg) separately.
I'm now using a normal mob(like a pig) and have an armorstand be its passenger, but armorstand only have six parts tha I can control.
So is there any way to fix the problem?

vivid skiff
#

How can i rotate the corpse entity as same as the cow, the cow rotates using the player Yaw?

vivid skiff
lost matrix
night verge
lost matrix
night verge
lost matrix
#

The most modern approach would be to translate BlockBench models
to display entities and translate those.

tranquil dome
#

So I've got two modules in my pom project, called api and plugin. In the api module is an interface called IPluginAPI. In the plugin module is a class called PluginAPI that implements IPluginAPI.

The PluginAPI class is defined in the Main class. You can get it with this.getAPI().

The api module is available on maven and can be added as dependency for other plugins.

Other plugins are able to cast the PluginAPI to IPluginAPI and use its methods.

My question is, how would other developers be able to use the getAPI() method if they cannot cast the Plugin to my Main class? I specifically don't want to upload my entire plugin to maven central, but just the api interface.

#

And if it is impossible to call the getAPI() method, is there another way other plugins can use the api?

echo basalt
#

I wonder how complicated writing my own modelengine would be

#

like

#

Is blockbench data easily formatted hmm

lost matrix
#

You would create a registry within your api module with a simple

IPluginAPI getAPI() {
...
}

method. This method either resolves your implementation
by getting it from the plugin, or you add a setter for your API implementation in your
registry. Btw no casting should be needed here as the other
dev will only see the interface.
@tranquil dome

compact haven
#

You can have an interface in the API module, APIProvider which declares a method getAPI and returns IPluginAPi

#

or you can also use the bukkit service registry like smile said

compact haven
echo basalt
#

Each cube has a UUID hmm

#

I wonder how different modelengine would be with display entities hmm

lost matrix
#

Because display entities have interpolation

echo basalt
#

yea

#

that's what I'm thinking

#

now

#

I did fail trigonometry and I don't know how quaternions work

#

but I can probably make this work

tranquil dome
#

So I'd use getServer().getServiceManager().register(IPluginAPI.class) and then other developers can get it?

echo basalt
#

anyone got a sample bbmodel for an entity with animations

tranquil dome
#

I'm still kind of confused tho, because would that run the methods through my plugin?

lost matrix
echo basalt
#

why two

lost matrix
#

One moment

echo basalt
#

I did try understanding quaternions once

#

but I spent 10 hours and felt dumber at the end

pseudo hazel
#

because its a better mathematical representation of whats actually going on and avoids some impossible rotation scenarios

#

but its complicated and weird to wrap your head around

echo basalt
#

it's some 4d shit that avoids gymbal lock, yes

#

with 3d you have some weird scenarios where you get limited

pseudo hazel
#

yeah

quaint mantle
lost matrix
echo basalt
#

1.8 broke like a month ago

#

minecraft servers removed the download iirc

#

like mojang's aws container is gone

#

from my understanding

lost matrix
quaint mantle
#

umm my english is not very good and i didn't understand much..

echo basalt
quaint mantle
#

I understand that 1.8.8 is broken and I was trying to no avail?

#

Can't I create custom server jar for 1.8?

#

@lost matrix

rotund ravine
#

I mean sure you can, you just gotta figure it out yourself or smth

daring lark
#
[18:48:17 ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'RDCakeLib.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.placek.rdcakelib.RDCakeLib'
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:78) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:123) ~[paper-1.19.3.jar:git-Paper-448]
        at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.19.3.jar:git-Paper-448]
        at io.papermc.paper.plugin.entrypoint.strategy.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:150) ~[paper-1.19.3.jar:git-Paper-448]
        at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:35) ~[paper-1.19.3.jar:git-Paper-448]
        at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[paper-1.19.3.jar:git-Paper-448]
        at org.bukkit.craftbukkit.v1_19_R2.CraftServer.loadPlugins(CraftServer.java:428) ~[paper-1.19.3.jar:git-Paper-448]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:273) ~[paper-1.19.3.jar:git-Paper-448]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1101) ~[paper-1.19.3.jar:git-Paper-448]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.19.3.jar:git-Paper-448]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

did anyone knows that is wrong with my plugin?

#
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:183) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:150) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        at java.lang.Class.forName0(Native Method) ~[?:?]
        at java.lang.Class.forName(Class.java:467) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        ... 10 more```
young knoll
#

Looks like your main class is set wrong in plugin.yml

daring lark
#

no

#

now it's working

#

i changed literally nothing lol

swift sequoia
#

Hi, i'am trying to get the item that i just placed in an inventory, but i cant get any way to get it properly without having to mess around with the clickType of the event and the amount of my itemstack, isn't there a way to get the exact ItemStack that was placed in an inventory ?

#

for exemple, if i have a stack of let's saw wood, and i right click in my inventory, i effectively place ONE wood, but the getCursor event obviously return 64, which is normal, i wanna get that one wood

frozen thorn
#

Hello, I'm using the raytrace method of player to get the BlockFace the player is aiming on BlockBreakEvent. Is it normal when I destroy blocks fast in creative mode sometimes the Block found in the raytrace is null?

vivid skiff
#

How can i get a item in NMS?

quaint mantle
#

I get error on 1.8.8 but install successfully without error on 1.16.5

ocean hollow
#

what is the best way to store HashMap<Location, Inventory> in yaml?

onyx fjord
#

is anyone aware how would i approach making a MOTD system that works even if server is off?

#

to you know display fallback message

tardy delta
#

why would it work if the server isnt running 💀

onyx fjord
#

i was thinking more about i dont know standalone java program

#

but it would override the port 🤔

floral drum
#

ah

#

If you look at bungeecord/velocity's source code, I think you could easily figure this out, it could add extra latency on top though, as there's another pipe/server it has to travel through to get to the client

onyx fjord
#

ye im gonna do that

floral drum
#

yea

onyx fjord
#

it could honestly just be a bungeecord host

floral drum
#

^

daring lark
#
java.lang.IllegalArgumentException: Plugin cannot be null
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.1-jre.jar:?]
        at org.bukkit.NamespacedKey.<init>(NamespacedKey.java:108) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at dawid.ratajczak.justbackpacks.backpack.BackpackManager.<init>(BackpackManager.java:21) ~[justBackpacks.jar:?]
        at dawid.ratajczak.justbackpacks.JustBackpacks.onEnable(JustBackpacks.java:19) ~[justBackpacks.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:279) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:192) ~[paper-1.19.3.jar:git-Paper-448]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.19.3.jar:git-Paper-448]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.19.3.jar:git-Paper-448]```
why my plugin is null?
#
@Override
    public void onEnable() {
        register(this, true);
        backpackManager = new BackpackManager(this);
        new Recipes(this).registerRecipes();
    }```
floral drum
#

BackpackManager line 21

lost matrix
#

*send

daring lark
#
public BackpackManager(JustBackpacks plugin) {
        this.plugin = plugin;
    }``` this?
#

but why?

lost matrix
#

Is this line 21?

#

This cant be line 21

floral drum
#

tf lol

daring lark
#
private NamespacedKey backpackContentKey = new NamespacedKey(plugin, "backpackContent");```
#

line 21

#

wait

lost matrix
#

Ah this is called before the constructor

daring lark
#

i know

#

i'm supid

daring lark
floral drum
#

Since the field "plugin" isn't defined yet when the class is created, you can't use it.

daring lark
#

i'm so dump

#

xD

worldly ingot
#

*amogus remix plays*

buoyant viper
quaint mantle
#

is there a reason why the override on "getPotionMeta().addCustomEffect(getPotionEffect(), true)" isnt actually overriding? it stacts the effect onto the #setBasePotionData().

lost matrix
#

Also: Naming conventions. "SECTION" should be "section"

quaint mantle
lost matrix
#

You can change the color without setting the base effect

quaint mantle
#

So only PotionEffect and PotionEffectType should matter? eh don't really need to create custom potions. only to have a custom Duration and Amplifier.

#

hence i setted the base ig.

vivid skiff
#

How can i change an EntityPlayer Bed position rotation in NMS?

buoyant viper
#

cant do it with spigot?

grizzled oasis
#

Hi how can i check if a day is passed and update the gui?

buoyant viper
vivid skiff
grizzled oasis
subtle folio
#

is there a way I can make it harder or impossible to remove my licensing system from my plugin?

rotund ravine
#

Or just check it on gui open

pine cipher
#

Hello i wanna ask about layer 0 in texture/resource packs. I want to make 3d model but 2d icon, I know it's possible but what I need to do and where i need to make this 2d icon on texture? example Spyglass

worn tundra
#

So spyglass is a special case, and mojang kinda broke it

grizzled oasis
#

Hi how can i get the last number in the getConfigurationSection and then add like 3 and continue
like:
1:
value: "2"
2:
value: "3"

worn tundra
pine cipher
#

ah ok thanks for help 😉

grizzled oasis
# worn tundra Wdym

i want make another in automatic with 1 + the last number, if the last number in the section is 2, when created will be 3

worn tundra
#

You want to get the value at 1.value and add 1 to that?

grizzled oasis
worn tundra
#

Oh

grizzled oasis
worn tundra
#

Like this

#

Hard to know without context what you specifically want

#

so

grizzled oasis
daring lark
#

how can i disable putting items into inventory. I know that i can use#setCancelled() but this sometimes doesn't work

daring lark
worn tundra
#

Which event(s) are you using currently to cancel it?

daring lark
#

inventoryClickEvent

worn tundra
#

Cancel InventoryDragEvent too

daring lark
#

i tried but idon't really know how to use that

worn tundra
#

It has a cursor

#

If you're trying to prevent a specific item being placed into another

#

Check if the cursor is another backpack

#

and then cancel it if the top inventory is a backpack inventory

#

InventoryClickEvent should cover all other cases

daring lark
#
@EventHandler
    private void onEvent(InventoryDragEvent event) {
        Logger.log("mam");
    }``` this doesn't log anything
worn tundra
#

It's when you hold left or right click and move the item across the inventory

daring lark
#

sometimes this is evet is not called

worn tundra
#

This event is called when the player drags an item in their cursor across the inventory.

daring lark
#
@EventHandler
    private void onEvent(InventoryDragEvent event) {
        Logger.log("Dadadadad");


    }```
remote swallow
#

System.out.println("something");

daring lark
remote swallow
#

it prints a line to console, no idea if Logger.log would do the same

daring lark
#
public static void log(Object... messages) {
        for(Object message : messages) {
            if(message == null) {
                continue;
            }
            Bukkit.getConsoleSender().sendMessage(color("&2[LOG] &a" + message));
        }
    }``` what's wrong with this?
remote swallow
#

ohhhh

#

yeah thats fine

#

is the event registered

daring lark
#

yes

#

becouse sometimes it's called

#

wait

#

does spigot creates separated class for every event or only calls method from the class and class is the same for every event?

indigo frost
#

how do i make an ItemStack unable to be placed?

daring lark
#

u mean block?

indigo frost
#

nope

#

an itemstack

remote swallow
remote swallow
indigo frost
#

so lets say i make a tripwire hook thats intended use is a right click action and i dont want it to be able to be placed

daring lark
remote swallow
#

if you create a class variable and only create one instance of that class all events in that class can access the variable

zealous osprey
#

Quick question, cause I am quite stumped at why this isn't working:

final World world = pl.getServer().getWorld((String) dataMap.get("world"));

It reads in "world_nether" instead of dataMap.get("world")

next parcel
remote swallow
#

do you hae the mavenLocal() in ur deps and have you ran buildtools

next parcel
#

opened a repo

#

i used a repo for a server im developer for, that's all i know really

#

would appreciate some guidance

remote swallow
#

to use nms you need to run buildtools for 1.18.2

#

?bt

undone axleBOT
tender shard
#

also you should be using remapped-mojang

#

org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT:remapped-mojang

remote swallow
#

without the other stuff to remap i wouldnt do that

#

but remapped is better if you can remap

tender shard
#

yeah ofc one also needs the remap plugin

zealous osprey
#

I resolved it, one should always load the world first, before trying to access the data XD

bronze fern
#

im trying to learn to code but everything i try doesnt work

fluid river
#

cool

#

go to search tab on this discord server

#

and type lessons

tender shard
bronze fern
#

i wanted to make a /fly command

tender shard
#

and what's your code and what exactly didn't work?

bronze fern
#

i saw this somewhere

#

package me.sw11per.flight;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

import
public class Commandkit implements CommandExecutor {

@Override
public void onEnable() {
    // Register our command "fly" (set an instance of your command class as executor)
    this.onCommand("fly").setExecutor(new Command() {
        @Override
        public boolean execute(@NotNull CommandSender commandSender, @NotNull String s, @NotNull String[] strings) {
            return false;
        }
    });

private void getCommand("fly") {
}
    commands:
    fly:
    description:
    usage: /<fly>
tender shard
#

?paste it please

undone axleBOT
tender shard
#

or use code tags

#

?code

bronze fern
#

oh

tender shard
#

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

    }
}```
remote swallow
#

first learn java

#

?learnjava

undone axleBOT
bronze fern
#

idfk

#

i just typed some stuff i found on google

tender shard
#

yeah well learn basic java first

fluid river
#

PR-ing myself here

vivid skiff
#

I need to use two version of worldguard to add legacy and not legacy support, but when i add the 2 worldedit dependencies i get this error cannot access com.sk89q.worldedit.Vector. How can i fix it?

tender shard
#

Use maven modules. One for WG6, one for WG7

vivid skiff
tender shard
#

are you already using maven?

vivid skiff
tender shard
#

I don't have time to explain it, but you can check out JeffLib - it has one core module, and different NMS modules that implement the AbstractNMSHandler interface from the core module. Then there's a "dist" module that packages all the modules in one .jar
https://github.com/JEFF-Media-GbR/JeffLib

tender shard
#

so you'd have e.g. a core module that declares a WorldGuardHandler interface, then a WG6 and WG7 module

#

note however, that either your core module depends on the WG6 and WG7 module, OR your wg modules depend on core. but you cant have both

#

so you either need a dist module too, or get the correct WG handler using reflection

vivid skiff
tender shard
#

(it's for NMS but ofc you can just adapt it for worldguard instead)

vivid skiff
#

And move the main one somewhere else?

tender shard
#

not sure what you mean

#

your parent pom will have <packaging> set to pom, then a list of your modules. that's basically it

lost matrix
#

Schedule a task and broadcast a message...

vivid skiff
kind hatch
#

The parent pom is in the root of the project directory. All other poms are located in the root of their respective modules.

tender shard
#

YourProject/pom.xml (parent pom.xml)
YourProject/core/pom.xml (core pom.xml)
YourProject/worldguard6/pom.xml (WG6 pom.xml) etc

vivid skiff
#

I should put the spigot api dependenci in the parent pom or on the core one?

kind hatch
#

If you're planning on supporting multiple versions, put it in the core, otherwise you can put it in the parent.

subtle folio
#

Why is this null? java RayTraceResult rEntity = p.rayTraceBlocks(3);

#

I have an if check below it, java if (rEntity == null) { System.out.println("Here"); return ""; }

#

and that is printing out "here"

eternal oxide
subtle folio
#

I see, what if I'm looking to raytrace an entity

eternal oxide
#

that method is for blocks

subtle folio
#

and what If im trying to look for raytracing to an entity?

eternal oxide
#

use a normal raytrace

subtle folio
#

What does this mean?

#

Like their hitbox?

#

if I just want to leave it as 0 will that affect anything

eternal oxide
#

its the width of the ray

young knoll
#

Yeah you can leave it as 0

eternal oxide
#

or use the one without a predicate for any

young knoll
#

Also shrinked should probably be shrunk

#

0/10 documentation

#

Literally unusable

tender shard
#

fuck irregular participles

subtle folio
eternal oxide
#

read teh javadoc I linked

subtle folio
#

got it

swift sequoia
#

Hi, is there a way to get the placed item in a inventory through the InventoryClickEvent ?
The only way i've found is to run a runnable 1 tick later and get the ClickedSlot to find out what item was placed, but i feel like it's prone to bug in the long run

analog thicket
#

How would i make armorstands not lag when tps is low? is this impossible or just a "Something you have to live with"?

eternal oxide
#

async with packets instead of spawned entities

analog thicket
#

Already doing packets

eternal oxide
#

then do it async not sync

analog thicket
#

Oh didn't even thing of that

#

Thx lol

tender shard
#

why would armor stands cause ANY tps drop if you only send packets?

analog thicket
#

It's not the armorstands

#

Its the amount of players :p

#

And some other stuff on the server.

tender shard
#

oh now I understand what you meant

analog thicket
#

Haha np

tardy delta
#

prove copilot is becoming self aware

tender shard
#

lol

tardy delta
#

i better dont use copilot to write a vm

eternal oxide
#

JNN is a jump instruction

tardy delta
#

jump if and what then

eternal oxide
#

Jump instructions JMP, JC, JNC, JN, JNN, JO, JNO, JZ, JNZ, and JSRcan use absolute addressing.

tardy delta
#

smth negative

tender shard
tardy delta
#

// idk

tender shard
tardy delta
#

💀

tender shard
#

lmao

tardy delta
#

the best things always come because of me being bored

subtle folio
#

is it possible to make ray trace entities not pick up the player that sent the request?

eternal oxide
#

in the predicate

vital bloom
#

is there a way to get these properties of a block in a world (not necessarily redstone but also fences, panes, doors, etc.)?

young knoll
#

BlockData

#

Block#getBlockData

indigo frost
#

what would be the event to get the arrow shot from an EntityShootBowEvent cause I wanna check them itemMeta of the arrow fired

vital bloom
indigo frost
#

what about the event to get the item placed in a brewing stand?

young knoll
#

InventoryClickEvent

indigo frost
#

aight ty again lol

young knoll
#

0-15

subtle folio
young knoll
#

WOOL:1 was like, orange

#

I think

subtle folio
vital bloom
# young knoll 0-15

i thought there was a more direct way than just having to parse the data byte into whatever property it is, but thanks

subtle folio
tardy delta
#

heh

subtle folio
#

Im not sure if this is correct, I am unfamiliar with Predicate

tardy delta
#

do you need Player.class::instance?

#

same as entity -> entity instanceof Player

subtle folio
#

oh

#

maybe isInstance

#

is the proper method

#

🤣

indigo frost
# young knoll InventoryClickEvent

what do i do with this event? I want to check if the item being placed in the brewing stand has a certain ItemMeta, and if it does, it cancels the event

young knoll
#

Check if the clicked inventory is a brewing stand, the clicked slot is the input, and the current item has your meta

#

Or the cursor item

subtle folio
#

Do people know how to check if its not a specific player?

eternal oxide
#

entity -> entity != player

terse ore
#

Guys, what do you think of me doing a server software in python

lost matrix
terse ore
#

lol

tardy delta
#

just write it in js 🤡

terse ore
#

it's obviously a fun project and not a functional one

worldly ingot
#

If your language of choice is capable of networking, it's possible

#

If I'm not mistaken there is already a Python implementation of a vanilla server

#

So you can use it as reference if you'd like

lost matrix
#

Do it in php

terse ore
#

the good thing of python is that if it can be done in C it can be done on Python

worldly ingot
lost matrix
#

Everything can be done in any turing complete language

terse ore
#

html would be mad

lost matrix
#

Thats not a turing complete language

terse ore
#

ik

subtle folio
worldly ingot
#

nvm, that library is so much more underdeveloped than I thought it was

subtle folio
#

Just returns null now

lost matrix
subtle folio
#

lemme change

winged anvil
#

broooo was about server in rust

subtle folio
#

for some reason isEqual doesn't like it..

#

bc it doesn't also take one

quaint mantle
#

can someone tell me if this would work
p.sendMessage(ChatColor.GREEN + "[V] You promoted" + args[3] + "to" + args[2]);

remote swallow
#

?tas

undone axleBOT
lost matrix
quaint mantle
#

well theres like 3 thins i tas rn in the code and i dont really know whats causing the issue

young knoll
#

Isn’t minecraft redstone Turing complete

tardy delta
young knoll
#

Someone make a server in redstone

tender shard
tardy delta
#

hmm nice touchpad stopped working

#

ah theres a button for that 💀

tender shard
#

there's a button to make the touchpad stop working?

lost matrix
#

🔨

tender shard
#

oh, THAT button

#

IJ has that button too

young knoll
#

Most touchpads have a toggle button

#

DaddyMd5

tender shard
lost matrix
young knoll
#

What does the daddymd5 class do

lost matrix
#

It daddies md5
You new to java?

tender shard
#

I wanted to see how good recaf's string decryption thing is

#

turns out, it's not very good at all

#

and this is how it's used. very useful, as you can see

winged anvil
young knoll
#

Lol

rare rover
#

does mc do garbage dumps. I'm too lazy to make a plugin to check

#

i dont see why it wouldn't

eternal oxide
#

garbage dumps?

rare rover
#

System.gc()

eternal oxide
#

if you mean garbage collection, thats upto the jre

rare rover
#

for WeakHashMaps and stuff

#

ye

#

oki

#

just checking

young knoll
#

I assure you minecraft does do garbage collection

rare rover
#

yeah

vocal cloud
#

Calling System.gc() is kinda not recommended

tender shard
#

unless you do it in a scheduler that runs every tick /s

delicate lynx
#

that will fix your GC problems! no lag anymore!

#

async System.gc() scheduler

tender shard
#

someone should turn this into a plugin

#

I bet ClearLagg already does it lol

humble tulip
#

while(true) {
System.gc();
}

ionic oxide
#

no way

young knoll
#

I mean

#

Calling GC is just a suggestion for the jvm

#

Also you can disable explicit GC with a flag

rare rover
rare rover
rare rover
#

I was too lazy to try

vocal cloud
#

You still shouldn't need to

rare rover
#

Dont you need garbage collection to remove everything in a WhekHashMap that doesn't have an instance?

#

Or whatever

quaint mantle
#

Was it not recommended not to do gc?
I mean, it can interfere in some plugins isn't it?

eternal oxide
#

don't force gc. The jre will do it when it needs

ivory sleet
rare rover
#

Oki

ivory sleet
#

WeakHashMap just won’t prevent garbage collection even though an entry is present in the map, unlike other Map implementations

#

System.gc() is also likely to be disabled by most servers due to a jvm flag, but it’s more of a request to the jvm than what it is of a commandment.

signal kettle
#

How I can change blockstate of Sculk Sensor?
I want it to update them in radius so they will make vibration

        int radius = 10;
        Location loc = block.getLocation();
        World world = loc.getWorld();
        for (int x = -radius; x < radius; x++) {
            for (int y = -radius; y < radius; y++) {
                for (int z = -radius; z < radius; z++) {
                    Block block1 = world.getBlockAt(loc.getBlockX() + x, loc.getBlockY() + y, loc.getBlockZ() + z);
                    if (block1.getType() != Material.SCULK_SENSOR) {
                        SculkSensor sensor = (SculkSensor) block1.getBlockData();
                        sensor.getPhase();
                        sensor.getPower();
                        sensor.setPhase(SculkSensor.Phase.ACTIVE);
                        sensor.setPower(15);
                        block1.setBlockData(sensor);
eternal oxide
#

wrong evaluationif (block1.getType() != Material.SCULK_SENSOR) {

eternal oxide
#

yes

signal kettle
#

okay thank you it's change it but it's not make vibration and send it to shrieker🤔

#

any idea?

eternal oxide
#

neither of these lines do anything sensor.getPhase(); sensor.getPower();

#

they are just getters which you are doing nothing with

signal kettle
young knoll
#

Vibrations are handled outside just changing the block data

eternal oxide
#

other than that, I've never used one so can't advise

young knoll
#

When they detect a sound they will send a signal to nearby shriekers

#

I don’t know if there is any api to send those signals

signal kettle
#

hmm maybe some sort of get around? Like make a fake steps or smth🤔

eternal oxide
#

you can set the last frequency on the TileState. I'd assume that to be the detected sound

narrow lichen
#

should i make a thread or just ask here

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!

eternal oxide
#

just ask, its not busy

narrow lichen
#

ah ok

#

what would be the easiest way to listen for http requests to the server?

eternal oxide
#

to the server?

#

MC isn;t listening on port 80

narrow lichen
#

can i listen for requests to other ports?

indigo frost
#

how can i get all entities between 2 points and set their AI to false?

eternal oxide
#

where are you expecting these requests to come from?

narrow lichen
#

a discord bot

eternal oxide
narrow lichen
#

that runs on the same server

remote swallow
#

wouldnt it be better to recode the bot in jda

eternal oxide
#

there is a discord plugin/api but I've not used it

remote swallow
#

jda i would say is the better ish java discord api

narrow lichen
eternal oxide
#

then do as Epic suggests and look up jda

narrow lichen
#

alright

#

i was hoping i didn't have to do that lol

#

thank you

eternal oxide
#

you should be able to connect your Spigot and Discord

remote swallow
narrow lichen
#

ah ok

#

i just have a lot more experience making bots in javascript

signal kettle
# eternal oxide you can set the last frequency on the TileState. I'd assume that to be the detec...
.03 00:34:10 [Server] ERROR Could not pass event PlayerInteractEvent to Oraxen v1.153.0
29.03 00:34:10 [Server] INFO java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftSculkSensor cannot be cast to class org.bukkit.block.SculkSensor (org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftSculkSensor and org.bukkit.block.SculkSensor are in unnamed module of loader java.net.URLClassLoader @7aec35a)
29.03 00:34:10 [Server] INFO at me.bially.cobaltmccore.urn.UrnListener.onBlockClick(UrnListener.java:52) ~[cobaltmccore-1.0.0.jar:?]
29.03 00:34:10 [Server] INFO at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor258.execute(Unknown Source) ~[?:?]
29.03 00:34:10 [Server] INFO at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
29.03 00:34:10 [Server] INFO at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
29.03 00:34:10 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:670) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
29.03 00:34:10 [Server] INFO at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:545) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.server.level.ServerPlayerGameMode.useItemOn(ServerPlayerGameMode.java:526) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:1969) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:37) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.a(ServerboundUseItemOnPacket.java:9) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:51) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1341) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:185) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1318) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1311) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:114) ~[?:?]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1445) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1173) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-307]
29.03 00:34:10 [Server] INFO at java.lang.Thread.run(Thread.java:833) ~[?:?]
#
        int radius = 10;
        Location loc = block.getLocation();
        World world = loc.getWorld();
        for (int x = -radius; x < radius; x++) {
            for (int y = -radius; y < radius; y++) {
                for (int z = -radius; z < radius; z++) {
                    Block block1 = world.getBlockAt(loc.getBlockX() + x, loc.getBlockY() + y, loc.getBlockZ() + z);
                    if (block1.getType() == Material.SCULK_SENSOR) {
                        SculkSensor sensor = (SculkSensor) block1.getBlockData();
                        sensor.setLastVibrationFrequency(15);
                        sensor.update();
winged anvil
#

wall

eternal oxide
#

teh frequency is on the TileState not blockData

#

wrong import

signal kettle
eternal oxide
#

so cast Block#getState()

#

set frequency

#

call update()

signal kettle
#

oh okay let me try

#

okay so now there's no errors but as well do nothing

        int radius = 10;
        Location loc = block.getLocation();
        World world = loc.getWorld();
        for (int x = -radius; x < radius; x++) {
            for (int y = -radius; y < radius; y++) {
                for (int z = -radius; z < radius; z++) {
                    Block block1 = world.getBlockAt(loc.getBlockX() + x, loc.getBlockY() + y, loc.getBlockZ() + z);
                    if (block1.getType() == Material.SCULK_SENSOR) {
                        SculkSensor sensor = (SculkSensor) block1.getState();
                        sensor.setLastVibrationFrequency(15);
                        sensor.update();
#

RIP(*) I think it's no doable;/

eternal oxide
#

what import are you using?

signal kettle
#

import org.bukkit.block.SculkSensor;

eternal oxide
#

good

#

try a different frequency

signal kettle
#

oh okay will try in that range each of them

#

if not then maybe I will try to replace them with the one that had this frequency in?

#

hmm seems like any frequency not make anything, stupid sculk thingy💀

young knoll
#

Like I said the sensors data has nothing to do with sending out the signal

#

I don’t know if we have any api to do so

pliant jungle
#

Im running the onCommand function with a switch statement inside it to for the commands, but whenever I run one command, all of them run. Anyone know why?

eternal oxide
#

no breaks

pliant jungle
#

wdym?

#

i cant use return;?

eternal oxide
#

you can

pliant jungle
#

then what

#

sry im kinda new

eternal oxide
#

?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.

pliant jungle
#

im not able to upload the entire switch statment cuz too many characters

#

and im not able to uplaod it as a .txt file either

eternal oxide
#

?paste

undone axleBOT
pliant jungle
#

specifically the upgrade command running downgrade

eternal oxide
#

you are not using break nor return in any of your switch elements

pliant jungle
#

oh ok

#

so if i add return true to all of the cases then i should work?

eternal oxide
#

yes

pliant jungle
#

ok tysm

young knoll
#

Switch statements exhibit something called fall through

#

Which means if it doesn’t encounter some kind of interruption, it will just continue through the cases in order

pliant jungle
#

that worked, thanks!

steep scroll
#

I am trying to make a plugin that makes it so that the glow effect is applied to your team mates(other people can not see the glow effect), I know I need packets but I do not know where to start.(If there is a plugin that dose this already that would be great to know)

verbal surge
#

I am trying to make a plugin for something, and I used chatgpt to make the code, how would I turn the visual studio code thing into a plugin

turbid tiger
#

Hello, trying to add NuVotifier as a dependency using gradle (I am a new gradle user) I've followed the instructions on their github and I get this error:

Searched in the following locations:
  - https://repo.maven.apache.org/maven2/com/vexsoftware/nuvotifier-universal/2.7.3/nuvotifier-universal-2.7.3.pom
  - https://repo.papermc.io/repository/maven-public/com/vexsoftware/nuvotifier-universal/2.7.3/nuvotifier-universal-2.7.3.pom
  - https://jitpack.io/com/vexsoftware/nuvotifier-universal/2.7.3/nuvotifier-universal-2.7.3.pom
  - https://oss.sonatype.org/content/groups/public/com/vexsoftware/nuvotifier-universal/2.7.3/nuvotifier-universal-2.7.3.pom```
Here is my build.gradle
```gradle
plugins {
    id 'java'
}

group = 'cc.creedcraft'
version = '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    maven {
        name = "papermc-repo"
        url = "https://repo.papermc.io/repository/maven-public/"
    }
    maven {
        url 'https://jitpack.io'
    }
    maven {
        name = "sonatype"
        url = "https://oss.sonatype.org/content/groups/public/"
    }
}

dependencies {
    compileOnly "io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT"
    compileOnly "com.vexsoftware:nuvotifier-universal:2.7.3"
}
... extra lines omitted...
}
#

Anyone know what the solution could be?

turbid tiger
#

For reference, here is what is on their github page

ebon topaz
#

hi how can i make it so my custom enchant that i made works with anvils?

young knoll
#

How did you make it

#

Is it done via PDC or have you done the janky thing and injected it into the Enchantment class

ebon topaz
#

public static void registerEnchantment(Enchantment enchantment) {

young knoll
#

That doesn’t really answer the question

#

But I’ll assume it’s the later

#

You’ll need to use the PrepareItemAnvilEvent and handle it manually

ebon topaz
#

so its better to use pdc to make custom enchantments with plugins?

young knoll
#

I mean either way you’ll need to handle it manually for anvils

#

But PDC is less of a hack

ebon topaz
#

is there any place i can go to learn how to use pdc

desert frigate
#

i was wondering if it was possible to have somewhat of a event waiter? is there a github somewhere for it or something. i basically want to wait for a event to happen then ignore it after that

young knoll
#

Set the Boolean to true, when the event eventually fires it will set it back to false

#

If it’s already false, your code will ignore the event

desert frigate
#

basically a event waiter but for different tasks

young knoll
#

Wdym unique

turbid tiger
#

Hello trying to add NuVotifier as a

young knoll
#

You aren’t saving the config

ebon topaz
#

whats the best way to get the 8 blocks around a face of a block

young knoll
#

Such as say, the 8 blocks above?

ebon topaz
#

like the face that im breaking i want to get the block to the left, right up and down

young knoll
#

Well you can use Block#getRelative(face) to get the block connected to any face

frozen thorn
#

Why there are events like BlockBreakEvent where there is a method getPlayer but the class doesn't extends any player interface or the class PlayerEvent? Why does spigot doesn't make an interface for each events like this ?

tender shard
#

What would be the use case? You listen to specific events, not to interfaces

ebon topaz
#

break a block as if it was being broken by a pickaxe?

urban trout
#

hey, i'm making a freeze command and I'm wondering what the best way to freeze someone would be? thanks

icy beacon
#

i'd create a map of UUID, Integer somewhere

#

when freezing, put the player's uuid with ticks to freeze as a value

#

and constantly have a per-tick scheduler running

#

that decreases the values in the map by 1

#

probably there's a better way

eternal oxide
#

surely it would just be a freeze/unfreeze

icy beacon
#

😛

eternal oxide
#

so a Set

icy beacon
#

oh yeah it's a set if it's untimed

urban trout
eternal oxide
#

then in PlayerMoveEvent cancel if the getFrom != getTo

icy beacon
urban trout
#

ok cool beans

icy beacon
#

btw does anybody know if it's fine to have a custom ACF context be nullable?

#

i couldn't find any info on that

urban trout
#

yo can i have a command and event in the same class

icy beacon
#

yeah why not

#

but please don't

urban trout
#

why

eternal oxide
#

depends how closely tied they are

icy beacon
#

it's like eating bread above your keyboard

#

ugly and probably could be better organized

icy beacon
urban trout
#

i do that all the time

icy beacon
#

just separate them

urban trout
#

ok cool beans

icy beacon
#

@lost matrix wake up super urgent extreme ACF assistance required

commandManager.commandContexts.registerContext(Kingdom::class.java) {
  kingdomManager.getKingdomByName(it.popFirstArg())
}

getKingdomByName(..) is nullable, so how would I handle that? would null checking be enough or do I have to do smth else

alpine swan
#

is there any way to get a player’s movement speed and direction? I guess I could dump it in a hashmap on every playermoveevent after calculating it, but would that cause lag with many players? Is there a better way?

icy beacon
#

is player.getVelocity() what you're looking for?

icy beacon
alpine swan
eternal oxide
#

?xy

undone axleBOT
alpine swan
#

…..the problem is that I need to grab the players speed and direction in a different event

eternal oxide
#

why?

#

you are still doing xy

alpine swan
#

I need to calculate how much of an effect to give to a player based on their speed and direction in relation to other players nearby to them.

eternal oxide
#

how/why are other players going to affect their movement?

hybrid spoke
#

i still dont get it

eternal oxide
#

are players magnetic or something?

alpine swan
eternal oxide
#

well thats completely different to what you asked

icy beacon
#

wait are you trying to calculate knockback

alpine swan
#

no, I just need the players speed and direction

alpine swan
eternal oxide
#

knockback would apply in the damage event

lost matrix
eternal oxide
#

are you trying to implement your own knockback?

hybrid spoke
undone axleBOT
eternal oxide
#

yep

alpine swan
#

what do you want me to tell you

eternal oxide
#

what you are tryign to do

lost matrix
eternal oxide
#

not what you have tried

icy beacon
# lost matrix Two options: - Null check in your command - Register a completion and annotate y...

i took a look at an example and handled it this way:

commandManager.commandContexts.registerContext(Kingdom::class.java) {
  val name = it.popFirstArg()
  val kingdom = kingdomManager.getKingdomByName(name)
    ?: throw InvalidCommandArgument(Messages.replace(messages.kingdomNotFound, "%name%", name).content())
  kingdom
}

because i do not need to have null kingdoms passed into my commands. is this fine as well?

icy beacon
#

alr tyty

ebon topaz
eternal oxide
#

no

ebon topaz
eternal oxide
urban trout
#

hey what do i use instead of playerchatevent cuz its deprecated

icy beacon
#

playerasyncchatevent

ebon topaz
eternal oxide
#

try it and see

urban trout