#help-archived

1 messages Β· Page 183 of 1

subtle blade
#

The colours in those lines are different than the ones outside of it

stuck quartz
#

how do i prevent SPECIFIC blocks from exploding from a bed in nether

quick arch
subtle blade
#

Then you too might want to take a colour blind test, Alter πŸ˜›

quick arch
#

no

subtle blade
#

@stuck quartz you can look at BlockExplodeEvent

stuck quartz
#

ok, thanks a lot

subtle blade
#

No, like, I'm serious lol. If you see 21 or 71, there's a chance that's colour-blindness

#

Take some tests

#

The actual number on that image is 74

sinful spire
#

lol i cant see specific orange-ish colors

#

like i could probably hex code them

quick arch
#

I was following the really green spots

#

😏

subtle blade
#

πŸ‘ Follow πŸ‘ all πŸ‘ the πŸ‘ green πŸ‘ spots πŸ‘

#

lol

quick arch
#

that's a lot of work

subtle blade
#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

quick arch
#

┬─┬ γƒŽ( γ‚œ-γ‚œγƒŽ)

sinful spire
#

πŸ‘

#

πŸ‘justπŸ‘ctrl+vπŸ‘itπŸ‘everyπŸ‘timeπŸ‘youπŸ‘typeπŸ‘aπŸ‘wordπŸ‘

unborn jewel
#

scam

lyric cypress
#

I have an eventhandler

#

@EventHandler
public static void onSpawn (CreatureSpawnEvent event) {
if(event.getEntityType() == EntityType.WITHER) {

#

if(event.getSpawnReason() instanceof )

#

how would I get the player that spawns the wither?

subtle blade
#

It's an == comparison, not an instanceof. They're enum constants

quick arch
#

Could check the player in a 3 block radius

lyric cypress
#

but how would I get the player from that?

subtle blade
#

Oh you want to get the Player. You'd have to listen for BlockPlaceEvents

keen compass
#

could use the blockplace event

quick arch
#

🀒

sinful spire
#

DarkReader?

quick arch
#

no, Stylus

subtle blade
#

If the CreatureSpawnEvent is called within a 1 or 2 tick time frame after BlockPlaceEvent for a wither skull or soul sand, that's the player

keen compass
#

recommend setting an object value of like the location or something from the build_wither event πŸ˜‰

#

Or block place event

sinful spire
keen compass
#

where it has the player info for you, and location, then its just a matter of using that in one of the other events

silent veldt
#

Don't forget, you can now build a wither with Soul Soil, so you'll need to check that too

pastel arrow
subtle blade
#

Is that supposed to have a distinct number? πŸ˜›

sinful spire
#

what the

#

thats gotta be a troll

subtle blade
#

because unless you try really hard, there's no number there

sinful spire
#

i see a 0 there

quick arch
#

it's all different shades of purple

subtle blade
#

Yeah with seemingly no distinct pattern

pastel arrow
#

Is that supposed to have a distinct number?
Nah just color changed it xD

subtle blade
#

Figured as much

quick arch
#

ah, I see it now.

subtle blade
#

unless you try really hard, there's no number there
because I was trying to see 74

sinful spire
#

what, excuse me, what

quick arch
#

It's the same 74 number image, just differently colored

subtle blade
#

He just colour shifted the original image

tacit trellis
#

What good math operations could I use to make an experience system that keeps getting harder to level up?

quick arch
#

I had many dumb equations

subtle blade
#

Often a good idea to play around with exponential equations in a math engine like Wolfram Alpha

quick arch
#
((x+2-(x^2/5)*((xlog(xz)/x^2)100) * -1/x * z/z/c)log(z)log(x)log(zx)/x)*(x/z)

if x = any number
z = 100
c = -1```
#

see?

#

dumb equations

#

I used that at one point but scrapped it

silent veldt
#

I recommend the factoral operator

#

Make it really hard

tacit trellis
#

uh

#

i will google it i guess

quick arch
tacit trellis
#

is that what you showed me?

sinful spire
#

i used ((level * 1.43) + Math.PI) * 0.93 idk why

quick arch
#

yes

#

or well, it should be

#

not sure anymore, it was done before covid-19

keen compass
#

generally the easiest way is tossing a percentage in there

quick arch
tacit trellis
#

but percentage could make it too hard I think

keen compass
#

or you can go with the infamous bell curve type

#

but then it starts to punish players that are good and supports players being bad XD

tacit trellis
#

idk what that is but ill google it later

#

oh

keen compass
#

there is many ways to go about it

quick arch
keen compass
#

and there isn't really a correct way either

#

its really just identifying how far you want the system to go

#

and how rapidly do you want it to increase in difficulty πŸ˜›

quick arch
#

oh wow

tacit trellis
#

anyone know what minecraft uses?

quick arch
#

x! is fascinating.

sinful spire
#

level * 2 if you want your users to quit πŸ˜„

keen compass
#

lmao

sinful spire
#

minecraft uses java

quick arch
#

x!

keen compass
#

double the difficulty for every level they gain

tacit trellis
#

lol

keen compass
#

yeah that will ramp up the difficulty XD

sinful spire
#

or if you want your users to go mad level^2

keen compass
#

lmao

subtle blade
#

lol. Just exponential. I like it

sinful spire
#

im good at making people mad πŸ˜„

subtle blade
#

Good luck with level 10, mother fuckers

quick arch
sinful spire
#

ohh

keen compass
#

just toss a negative in there too @sinful spire πŸ˜‰

sinful spire
#

what minecraft uses for levels, im dumb

tacit trellis
#

yes

#

choco idk what that is but Ima also google it

quick arch
#

Exponential?

#

Simple

keen compass
#

always fun to play with a flip flopping system. Every other difficulty is difficult and the difficulties in between are super easy so there is no getting used to it πŸ˜›

subtle blade
#

No KEKW please don't make it exponential

#

Your users will hate you

quick arch
#
5^2
5 * 5
#

5^10
5*5*5*5*5... (until it reaches 10)

tacit trellis
#

oooh i know what it is i just dont do my math in english lol

#

definitely not that

quick arch
#

Exponential is the way to lose users

#

especially Choco

keen compass
#

There is many game algorithms out there, and always new ones being created

sinful spire
#
if(player.getLevel() == 10) {
  resetLevel(player);
}``` haha
quick arch
#

Should just divide their level by 2^2^2^2^2^2^2

silent veldt
#

I still think you should use Level!

quick arch
tacit trellis
#

whats Level?

quick arch
#

oh boy, factorial is another way to lose users

sinful spire
#

thats too much for js

quick arch
#

It's too much for google as well

sinful spire
#

0.1 + 0.2 = 2.999...8 in js

keen compass
silent veldt
#

and that's why we hate float and double

keen compass
#

gives a nice slight upward trend and then in the higher levels starts to ramp up

silent veldt
#

nextLevelXP = currentXP + 1

tacit trellis
#

doesnt it become impossible towards the end?

keen compass
#

eventually if you never define an end

grim halo
#

When i want to calc experience formulas i grab something like Maple and just plot it so i get a feeling for the curve.

quick arch
#

inb4 someone wants high experience for "OP" servers

subtle blade
#

Fucking Maple

sinful spire
subtle blade
#

It's been forever since I've used Maple lol

quick arch
#

that's a good leveling system indeed

#

making it negative should make it face the right way, yeah? πŸ€”

keen compass
#

lol all over the place with that

tacit trellis
#

okay thanks guys I will look through all the suggestions and find something that suits me

grim halo
silent veldt
#

They've ported Doom to everything I think

sinful spire
#

i ran Doom on a Fridge in a shop so yeah.

keen compass
#

@tacit trellis just play around with graphing stuff until you find something you like

tacit trellis
#

also I have another question, is it possible to add my own methods to Player? like player.getLevel() for example?

keen compass
#

but just remember, if you don't define the upper limit, it will eventually become impossible at some point lmao

grim halo
#

@tacit trellis You need to fork spigot for that

tacit trellis
#

okay

sinful spire
#

yeah, i need that one too for some stuff dont think its possible with my java knowing

tacit trellis
#

I could do that

grim halo
#

Or... you could inject bytecode. XD

tacit trellis
#

idk what that is

silent veldt
#

It would be much easier to make some sort of wrapper or adapter class for that

keen compass
#

injecting bytecode isn't always an ideal thing to do lmao

grim halo
#

Its mostly a bad bad idea

keen compass
#

great way to mess up JIT

#

πŸ˜‰

grim halo
#

Yes what CraigPatron said. Write a wrapper class.

tacit trellis
#

you mean like β€˜CustomPlayer’ class for example and then getPlayer()?

silent veldt
#

Yeah, but make sure you store your player reference as a UUID

keen compass
#

sometimes I love this community, given enough time we can give you a bunch of useless useful stuff in which most of it might be interesting but probably won't use πŸ˜›

quick arch
#

we can give you a bunch of useless useful stuff
yes, like Choco is dumb

grim halo
#

You dont absolutely have to use an UUID for mapping players. I too was in the team "no game object references EVER"
But if you properly manage your references you can just use Player object.

silent veldt
#

What makes sure his custom player ever releases the reference?

#

For the extra overhead of ensuring the reference doesn't persist too long, in my opinion, it's easier just to store a UUID

chrome lark
#

yea, but then getPlayer turns into a map lookup

#

Which, sure, probs ain't an issue for most cases, but, if you can avoid it πŸ€·β€β™‚οΈ

silent veldt
#

yup, which isn't a big deal

chrome lark
#

You'll wanna be disposing of your custom player objects when people log out anyways

grim halo
#

You have a Map<Player, WrappedPlayer>. The WrappedPlayer also encapsulates the Player.
If you remove the Player from the Map the GC will collect the wrapped player.
Then from the WrappedPlayer you either only have something like Consumer<Player> for interaction.
Or you only pass a WeakReference<Player> outwards

#

Just remove the Player when logging out.

polar gust
#

does reflections work in a minecraft plugin?

silent veldt
#

Sure that can work, when done properly

grim halo
#

Yes reflections work in Java...

silent veldt
#

That's a broad question David

polar gust
#

I'm getting no def errors

#

it apparently cannot find org.reflections.Reflections

silent veldt
#

org.reflections?

polar gust
#

yeah

grim halo
#

I dont know that package...

silent veldt
#

that isn't a package

#

I imagine you wouldn't find it

grim halo
#

its not from the standard library

polar gust
#

its another jar

#

or dependency

lyric cypress
#
public class CoolChicken extends EntityChicken
{
    public CoolChicken(Location loc)
    
    {
        super(EntityTypes.CHICKEN, ((CraftWorld) loc.getWorld()).getHandle());
        
        this.setPosition(loc.getX(), loc.getY(), loc.getZ());
        this.setCustomName(new ChatComponentText("Cool Chicken"));
        this.setCustomNameVisible(false);
        this.goalSelector.a(0, new PathfinderGoalFloat(this));
        this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, false));
        this.goalSelector.a(4, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
        this.goalSelector.a(7, new PathfinderGoalRandomStroll(this, 1.0D));
        
        this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
        this.targetSelector.a(0, new PathfinderGoalHurtByTarget(this, EntityHuman.class));
        this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, Entity.class));
        this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<EntityHuman>(this, EntityHuman.class, true));
    }
}

I have a chicken

silent veldt
#

If you're using another library make sure your dependencies are setup properly

lyric cypress
#

but when it attacks it disappears and leaves this error

#
java.lang.IllegalArgumentException: Can't find attribute minecraft:generic.attack_damage
#

how would I add minecraft:generic.attack_damage

grim halo
#

XD a fighting chicken. Did you try giving him the attribute?

lyric cypress
#

no I don't know how to do that

polar gust
#
    <dependencies>

        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <version>0.9.12</version>
        </dependency>

    </dependencies>
```what else do I need to add?
grim halo
#

What version are you on sticky?

lyric cypress
#

1.16.1

grim halo
#

Ok ill dig a bit.

lyric cypress
#

thank you

silent veldt
#

If the dependency is loaded correctly it should work. Is the Reflection class you seek in that version of the library?

polar gust
#

yeah

#
        at com.david.specialwolves.Main.onEnable(Main.java:23) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot.jar:git-Spigot-800b93f-8160e29]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:352) [spigot.jar:git-Spigot-800b93f-8160e29]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:417) [spigot.jar:git-Spigot-800b93f-8160e29]
        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugin(CraftServer.java:462) [spigot.jar:git-Spigot-800b93f-8160e29]
        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugins(CraftServer.java:376) [spigot.jar:git-Spigot-800b93f-8160e29]
        at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:457) [spigot.jar:git-Spigot-800b93f-8160e29]
        at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:267) [spigot.jar:git-Spigot-800b93f-8160e29]
        at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:784) [spigot.jar:git-Spigot-800b93f-8160e29]
        at java.lang.Thread.run(Thread.java:835) [?:?]
Caused by: java.lang.ClassNotFoundException: org.reflections.Reflections
        at java.net.URLClassLoader.findClass(URLClassLoader.java:436) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:146) ~[spigot.jar:git-Spigot-800b93f-8160e29]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:92) ~[spigot.jar:git-Spigot-800b93f-8160e29]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:588) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
        ... 10 more``` that is what I'm getting
grim halo
#

But you can compile?

polar gust
#

Main.java:23 is Reflections reflections = new Reflections("");

#

yes

grim halo
#

Then shade the dependency

lyric cypress
#

I got ClassNotFoundException once when i used spigot 1.15.2 as a dependency on a 1.16 server

#

maybe that's it?

polar gust
#

my server and plugin are both 1.15.2 though

#

I dont know if I'm skilled enough to shade lol

grim halo
#

No your problem is that a chicken does not have an attack attribute. So the server cant calculate the attack damage.
Im currently looking at the AttributeBaseMap but it seems like you are going to need reflections to access the attribute map and
add new AttributeBases

#

But im not done looking

elder fossil
#

how can I change the biome of my entire world ?

sinful spire
#

that would be hard without a small world

grim halo
#

Not too hard. I just wrote a plugin for someone that gets every single chest in a World.
2 lines changed and it can do anythin else with every chunk in a world

#

Wait. I think i even wrote an api for that. Wait a min

polar gust
#

is there another dependency I need to add?

tacit trellis
#

Is it possible to use Bukkit Events when I fork spigot? For example I could make a spigot fork that sends a player a message on PlayerJoinEvent

lyric cypress
#

yes

tacit trellis
#

Can I just make a new class and so it the exact same way i would with a plugin and register it in onEnable or no?

grim halo
#

Currently the time per tick is hardcoded to 39.5ms. I'll post another version in a min where you can pass that in the api call.

sinful spire
#

ok thats cool

#

it looks esay

quick arch
#

πŸ€”

sinful spire
#

easy*

grim halo
#

And you can play while this is happening. If you pass 10ms the tps wont drop as you iterate over the chunks.

quick arch
#

inb4 potato pc

stuck quartz
#

how can i get DoubleChest from Block

grim halo
#

@stuck quartz Essentially you get the chest. get the inventory holder. check if that is instance of double chest.

polar gust
#

Is there any possible problem for Reflections not being recongnize? This is my 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>group</groupId>
<artifactId>artifact</artifactId>
<version>V2</version>

<dependencies>

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

    <dependency>
        <groupId>org.reflections</groupId>
        <artifactId>reflections</artifactId>
        <version>0.9.12</version>
    </dependency>

</dependencies>

<repositories>

    <repository>
        <id>spigot-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>

</repositories>

</project>```

stuck quartz
#

@grim halo how can i cast a InventoryHolder to a DoubleChest

#

(DoubleChest) InventoryHolder

grim halo
#

Basically yes.

quick arch
#

He just said it

#
  1. You get the chest.
  2. Get the inventory holder.
  3. Check if that is instance of double chest.
grim halo
#

You just need to check if its actually a double chest.

quick arch
#

Slot size πŸ€”

stuck quartz
#

ok, thanks

grim halo
#

@polar gust If you want to access nms you need

    <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>bukkit</artifactId>
            <version>1.16.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
    </dependency>
polar gust
#

wait I thought there was something else

#

Im using a jar instead

#

I thought the NMS one was craftbukkit

grim halo
#

or wait...

#
    <dependency>
      <groupId>org.bukkit</groupId>
      <artifactId>craftbukkit</artifactId>
      <version>1.16.1-R0.1-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>
polar gust
#

it doesnt work for me, apparently you have to do something with buildtools

#

Im just gonna use a jar

#

I'm just confused about reflections not working

grim halo
#

You just need to run BuildTools once and everything gets automatically installed in your maven repo

polar gust
#

oh let me try that again, I dont think ive ran it in a while

stuck quartz
#

how can i get Block from InventoryHolder

grim halo
stuck quartz
#

im going to try
((BlockInventoryHolder) doubleChest.getLeftSide()).getBlock()

polar gust
#

is there any reason that reflections wouldnt be recongnized?

magic sun
#

is there a way to limit lag caused after sending a player sendblockchange (is it lighting?)

polar gust
#

I'm reading about NoClassDefFoundErrors, and the most likely reason seems to be that I define the class in a ClassPath attribute, but is there even such thing in this?

keen compass
#

NoClassDefFound Exception happens when you depend on something and that something isn't present when it comes time to invoke it

grim halo
#

As i told you. Shade your dependency

polar gust
#

I guess I'll learn to do that. Is it difficult?

keen compass
#

no

#

Maven provides an easy way to do that πŸ˜‰

grim halo
#
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.2</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createDependencyReducedPom>false</createDependencyReducedPom>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
  </build>
#

Add this to your pom

#

Ah and change ${java.version} to 8 or whatever you want

#

1.8*

keen compass
#
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
``` This isn't necessary to add
polar gust
#

do I need any changes in any of the other code? Like references to the dependencies?

grim halo
#

Nope. Default scope is compile so you should be good to go.

polar gust
#

just realized that running mvn install makes 2 jars, one original

#

whats the difference? is one without shading?

grim halo
#

yes

polar gust
#

Which one is the one without shading though?

#

assuming its the original

#
    public static Object getPrivateField(String fieldName, Class<?> clazz, Object object) {
        try {
            Field field = clazz.getDeclaredField(fieldName);
            field.setAccessible(true);
            return field.get(object);
        } 
        catch(Exception e) {}
        return null;
    }

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public static void register(String name, int id, Class<?> registryClass) {
        ((Map) getPrivateField("c", EntityTypes.class, null)).put(name, registryClass);
        ((Map) getPrivateField("d", EntityTypes.class, null)).put(registryClass, name);
        ((Map) getPrivateField("f", EntityTypes.class, null)).put(registryClass, id);
    }
```I've also literally copied this code from someone for registering code, does this work? I'm getting NullPointer in the first line of register
grim halo
#

Did you work with reflections before?

polar gust
#

I basically just used it for checking annotations

grim halo
#

Work with Nullable and NotNull annotations so you dont run into problems with your arguments beeing null.
Did you make sure that name and registryClass are both not null

#

Also you try to get the field value from a null Object...

#

You can only do that with statics

polar gust
#

I know the values I input into register are not null

#

I dont really know how registering even works, so I just copied this from someone, so I dont really know why its getting fields from null

grim halo
#

Are you on 1.16? Also whats the registryClass

lone fog
#

Registering custom entities? Fun times

polar gust
#

I'm on 1.15.2, registryClass is about 10 class that are all child of EntityWolf

#

Registering entities was why I quit minecraft plugins like 3 years ago lol

#

from 1.12 to 1.13 I couldnt find how to register entities

lone fog
#

Last I did it was 1.14

#

And I'll have to do it again soon in 1.16, and it's probably changed 500 ways

polar gust
#

Now I'm getting AuthorNagExceptions telling me that I forgot to define the api-version as 1.13, why does it think it should be 1.13?

keen compass
#

depending which version, that is the lowest supported api version for legacy stuff

#

set the api version to whatever you are compiling against

#

so if you compiling for 1.16, set it to 1.16 for api-version

lone fog
#

I used to use 1.13 for everything

#

I didn't know higher ones existed :p

stable ermine
#

Is there a flag to disable the vanilla console window when starting the server?

grim halo
#

--nogui

lyric cypress
#

7smile7 there is this spigot thread. In Deerjump's reply, do you know what type and model are?

#

I would guess type would be like EntityType.CHICKEN or something, but I have no idea what model would be

polar gust
#

in plugin.yml, I have to set api-version to 1.15?

lyric cypress
#

if you're using 1.15 then probably yes

grim halo
#

@lyric cypress Ah that exactly what i was doing earlier. Yes the type would be CHICKEN but the model i would need to check myself

polar gust
#

the bukkit wiki really should update their doc on plugin.yml

tender blaze
#

hello

#

how do install plugin to serber

keen compass
#

@polar gust and who exactly would you want to do that?

#

last I checked there is no more bukkit people XD

polar gust
#

oh shoot what happened

keen compass
#

they all quit

#

like almost 6 years ago now o.O

#

not sure where you have been

polar gust
#

oh idk

#

I used their forums and docs like 3 years ago

keen compass
#

yeah you can use the forums and what not, Curseforge just does the minimal necessary to keep that stuff running

#

but they are not going to do any updating of bukkit stuff

weary tinsel
#

Help Im making a minecraft faction server with some friends

#

But we want to play in the latest version 1.16.1

keen compass
#

?bt

worldly heathBOT
grim halo
#

DEFAULT_ATTRIBUTES.put(type, X); where X is of type AttributeProvider

weary tinsel
#

Could someone please list a few of the essential plugins for 1.16 because most that i download are for plder versions

keen compass
#

google is your friend

#

we are not google

tender blaze
#

how do i nstall a plugin into my serber

keen compass
#

put it in the plugins directory

polar gust
#

I believe 1.16 is pretty new

lyric cypress
#

drag the jar into the plugins folder

tender blaze
#

my serber is 1.15.2

#

there isnt a plugins folder

keen compass
#

not sure how that is relevant but ok

tender blaze
#

so i made one

#

then i put into folder

#

and not work

lyric cypress
#

run the spigot jar

#

and it will make one

grim halo
keen compass
polar gust
lone fog
#

Probably not an easy thing to find

#

Might be best to find an open source plugin that does it

lyric cypress
#
public class CoolChicken extends EntityChicken
{
    private static final Map<EntityTypes<?>, AttributeProvider> DEFAULT_ATTRIBUTES;
    static {
          try {
             final Field modifiers = Field.class.getDeclaredField("modifiers");
             modifiers.setAccessible(true);
             final Field field = AttributeDefaults.class.getDeclaredField("b");
             modifiers.setInt(field, modifiers.getInt(field) & ~Modifier.FINAL);
             field.setAccessible(true);
             DEFAULT_ATTRIBUTES = new HashMap((Map<EntityTypes<?>, AttributeProvider>) field.get(null));
             field.set(null, DEFAULT_ATTRIBUTES);
          } catch (Throwable reason) {
             throw new RuntimeException(reason);
          }
       }
    public CoolChicken(Location loc)
    
    {
        super(EntityTypes.CHICKEN, ((CraftWorld) loc.getWorld()).getHandle());
        
        DEFAULT_ATTRIBUTES.put(EntityTypes.CHICKEN, EntityInsentient.p().a());
        
        this.setPosition(loc.getX(), loc.getY(), loc.getZ());
        this.setCustomName(new ChatComponentText("Cool Chicken"));
        this.setCustomNameVisible(false);
        this.goalSelector.a(0, new PathfinderGoalFloat(this));
        this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, false));
        this.goalSelector.a(4, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
        this.goalSelector.a(7, new PathfinderGoalRandomStroll(this, 1.0D));
        
        this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
        this.targetSelector.a(0, new PathfinderGoalHurtByTarget(this, EntityHuman.class));
        this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, Entity.class));
        this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<EntityHuman>(this, EntityHuman.class, true));
    }
}

now I have this

#

how do I add attack damage?

stuck quartz
#

is there a way to display some player a sign and get his input?

lyric cypress
#

ye

stuck quartz
#

how

grim halo
#

Add an instance of AttributeProvider to your DEFAULT_ATTRIBUTES map.

naive goblet
#

Sticky jesus that code

stuck quartz
#

not that

frigid ember
#

try explaining it in a different way

stuck quartz
#

ok

#

i want to display a sign in the player screen and then get his input when he finish writing

polar gust
#

wait is there no good way to register entities?

frigid ember
#

ok what do you mean by displaying a sign

#

a message to their screen?

#

and then wait for a player type something in chat

stuck quartz
#

no, a empty sign, that the player can write in

frigid ember
#

A

stuck quartz
#

you know when you place a sign and it shows up a gui to write the lines?

#

is there a way so i can display that sign gui

frigid ember
#

u want to play a sign in front of them?

stuck quartz
#

i want to show the sign gui

#

so the player can write in and i can get the debug

frigid ember
#

u want to force a player to open a sign?

stuck quartz
#

yes

frigid ember
#

is that even possible

#

dunno

hollow hedge
#

It is.

#

Only way to obtain text is through NMS afaik

#

Well. Actually. You should be able to do it via the sign events.

stuck quartz
#

but how do i force open the sign gui

frigid ember
#

yeah how do that im curious

lyric cypress
#

@grim halo

AttributeProvider provider = EntityInsentient.p().a(new AttributeBase("minecraft:generic.attack_damage", 2.0D)).a();
DEFAULT_ATTRIBUTES.put(EntityTypes.CHICKEN, provider);

I did this but it says:
The constructor AttributeBase(String, double) is not visible

#

How should I create an AttrivuteBase

#

AttributeBase

frigid ember
#

i wonder if the player object has a method that can force a sign gui

#

in the api

lyric cypress
#

no

#

do it in the sign

#

actually no nvm

torn robin
#

You could also do it with packets

tender blaze
#

nothing works i cant install plugins

lyric cypress
#

7smile7 what do I use as the AttributeBase?

polar gust
#

Can you get a EntityTypes from id?

frigid ember
#

Any idea why the memory builds up and then does a dump every few intervals?

#

It does this without plugins too

balmy sentinel
#

how hard would it be to convert a plugin to bungee?πŸ€”

frigid ember
#

how hard would it be to convert a plugin to bungee?πŸ€”
@balmy sentinel depends...

balmy sentinel
#

on?

#

it's like a medium-sized plugin, maybe 4-6 commands

#

uses a database to store everything

keen compass
#

@frigid ember that is GC doing its job

#

everytime it hits a certain limit as noted by your graph, GC starts getting to work to free up some memory by removing objects not needed anymore, and thus it goes back down πŸ™‚

frigid ember
#

thats what i thought, thanks!

inland oxide
#

does the bungee api shaded into spigot 1.16.1 no longer support ChatColor?

quick arch
#

It should have the class

frigid ember
#

Hello, I Have 2 Servers But Not Bungee Hosted. I Want To Be Able To Connect To Them Without Having To Leave The Servers. I Want It To Be In A Server Selector. Is That Possible?

inland oxide
#

ah I see, class instead of enum

quick arch
#

oh, ChatColor enums

inland oxide
#

not backwardly compatible

#

missing

quick arch
#

Enums still show for me

inland oxide
#

someone is getting NoClassDefFoundError on my plugin on 1.16.1

quick arch
#

πŸ€”

inland oxide
#

it weird

pastel arrow
#

IDK why but on 1.16 check.getLocation().getBlockX() >> 4 is erroring x out of range (expected 0-15, got -10) Any ideas?

inland oxide
#

they are using paper tho

frigid ember
#

Hello, I Have 2 Servers But Not Bungee Hosted. I Want To Be Able To Connect To Them Without Having To Leave The Servers. I Want It To Be In A Server Selector. Is That Possible?

quick arch
#

which plugin is it

#

AuctionHouse?

ripe spear
#

U need bungee to do that

quick arch
#

^

#

per "world server" sucks

grim halo
#

@pastel arrow You are trying to get the block inside a chunk? Because there are only x and z of value [0;15]

frigid ember
#

Theres No Way U Can Do It Without?

inland oxide
#

failing on converting a BaseComponent to string

ripe spear
#

Then use server selector

pastel arrow
#

You are trying to get the block inside a chunk? Because there are only x and z of value [0;15]
Yes and please read the code.

ripe spear
#

To conncet using bungeecord

inland oxide
#

disclaimer, i know this is not a "**per" forum, but this is the error

grim halo
#

@pastel arrow The code snippet you posted makes no sense.

pastel arrow
#

I forgot the negative portion. I fixed it.

grim halo
#

Thats an arithmetic operation and wont throw this error ever

lyric cypress
#

@grim halo

AttributeProvider provider = EntityInsentient.p().a(new AttributeBase("minecraft:generic.attack_damage", 2.0D)).a();
DEFAULT_ATTRIBUTES.put(EntityTypes.CHICKEN, provider);

I did this but it says:
The constructor AttributeBase(String, double) is not visible

grim halo
#

Then get the constructor using reflection and set it accessible

inland oxide
#

this is the code in question

grim halo
#

Or search for another constructor that takes a minecraftkey

pastel arrow
#

& 0xF was what fixed it.

#

forgot to hit enter lol

grim halo
#

So you masked the sign bit away. Still... try to post a bit more context next time pls

pastel arrow
#

πŸ‘

storm sparrow
#

Anybody know a good vanish plugin that can hide players from a bungee tab list plugin like BTLP?

keen compass
#

@inland oxide only thing I can think of is that they are using an outdated bungee version in comparison to the mc server

#

or a custom bungee version

inland oxide
#

or maybe a waterfall version?

keen compass
#

that could probably do it

pastel arrow
#

Huh... so ((check.getLocation().getBlockX() >> 4)& 0xF) is returning 6 when its at 10 in the chunk.

If I put 6,80,6 it still uses 6,80,6 tf?

inland oxide
#

I'll ask what they are using

#

but it shouldn't make a difference if Spigot shades in the bungee api.

keen compass
#

it does if they used an outdated version to shade in

inland oxide
#

they as in "**per"?

keen compass
#

well just because it is paper doesn't mean they couldn't have compiled it themselves

#

but generally this is the result of either using a different but similar dependency

#

or just outright using an outdated dependency

inland oxide
#

let me look at the commits and see what they are using

keen compass
#

wouldn't surprise me if the version being shaded in is 1.13 lol

inland oxide
#

#91

#

so 3 days old

keen compass
#

somewhere that api method was altered

void sparrow
#

is it possible to refund a plugin?

#

i purchased the wrong one

keen compass
#

yes, however that is between you, the plugin author and paypal

void sparrow
#

uhg

#

kkz

keen compass
#

technically 4 days old @inland oxide

#

seems there is a fix in the latest version as well

#

in regards to chat color

#

recommend they update @inland oxide πŸ˜‰

#

and this is how a fork can be responsible for problems even if it doesn't seem apparent at first πŸ˜›

pastel arrow
#

I figured it out...
location.getBlockX() >> 4 is to get the chunks X coord.
location.getBlockX()& 0xF is to get the coord of the block in the chunk.

stuck quartz
#

how do i force open the sign gui and then get what the player wrote

keen compass
#

you can't

#

that is client side

stuck quartz
#

i saw a server with something like that, but i forgot which server

keen compass
#

you can get what they wrote once they close it, but only works for newly created signs

#

but you can't force open the sign editor

stuck quartz
#

ok, thanks

lyric cypress
#
Class[] cArg = new Class[2];
cArg[0] = String.class;
cArg[1] = double.class;
Constructor constructor;
try {
    constructor = net.minecraft.server.v1_16_R1.AttributeBase.class.getDeclaredConstructor(cArg);
} catch (NoSuchMethodException e1) {
    e1.printStackTrace();
    return;
} catch (SecurityException e1) {
    e1.printStackTrace();
    return;
}
constructor.setAccessible(true);
AttributeBase base;
try {
    base = (AttributeBase) constructor.newInstance("minecraft:generic.attack_damage", 2.0D);
} catch (InstantiationException e) {
    e.printStackTrace();
    return;
} catch (IllegalAccessException e) {
    e.printStackTrace();
    return;
} catch (IllegalArgumentException e) {
    e.printStackTrace();
    return;
} catch (InvocationTargetException e) {
    e.printStackTrace();
    return;
}
DEFAULT_ATTRIBUTES.put(EntityTypes.CHICKEN, EntityInsentient.p().a(base).a());

I am still getting the error, no stacktrace in printed when the chicken is summoned, but when I am attacked by the chicken, I get
java.lang.IllegalArgumentException: Can't find attribute minecraft:generic.attack_damage
Am I doing it wrong?

inland oxide
#

@keen compass yeh, I gave them the spcheel about how stuff is still beta and Paper/Waterfall being downstream and such, not to get expectations up and to update frequently...

#

My guess is that Waterfall is too old and not playing nice.

stoic shell
#

Hey, in a plugin, how can I send a response to the console if a command from the plugin is executed from console?

naive goblet
#

if (!(sender instanceof Player)) {
sender.sendMessage(β€œ...”);
}

#

Or check if it instances of ConsoleCommandSender

inland oxide
#

@lyric cypress where is DEFAULT_ATTRIBUTES from?

naive goblet
#

Perhaps that’s more accurate

#

Sticky please catch ReflectiveOperationException instead

#

Also why use 2 try-catch blocks

#

Only 1 is necessary?

lone fog
#

I’m almost certain you can open the sign GUI

#

At least in 1.8 you can

inland oxide
#

need to make the tile entity editable

wind dock
#

@keen compass sorry for pinging you but you seem to know about srv records - so this is my first time setting up a srv record in namecheap, whats the protocol and service name?

#

Or if anyone knows

rotund orbit
#

Does the lore of an item have to be visible to the player, or can I hide it from the player but still read it from the object in a method?

lyric cypress
#

@inland oxide
here is the rest

public class CoolChicken extends EntityChicken {
    private static final Map<EntityTypes<?>, AttributeProvider> DEFAULT_ATTRIBUTES;
    static {
        try {
            final Field modifiers = Field.class.getDeclaredField("modifiers");
            modifiers.setAccessible(true);
            final Field field = AttributeDefaults.class.getDeclaredField("b");
            modifiers.setInt(field, modifiers.getInt(field) & ~Modifier.FINAL);
            field.setAccessible(true);
            DEFAULT_ATTRIBUTES = new HashMap((Map<EntityTypes<?>, AttributeProvider>) field.get(null));
            field.set(null, DEFAULT_ATTRIBUTES);
        } catch (Throwable reason) {
            throw new RuntimeException(reason);
        }
    }

    public CoolChicken(Location loc)

    {
        super(EntityTypes.CHICKEN, ((CraftWorld) loc.getWorld()).getHandle());

        Class[] cArg = new Class[2];
        cArg[0] = String.class;
        cArg[1] = double.class;
        Constructor constructor;
        constructor = net.minecraft.server.v1_16_R1.AttributeBase.class.getDeclaredConstructor(cArg);
        constructor.setAccessible(true);
        AttributeBase base;
        base = (AttributeBase) constructor.newInstance("minecraft:generic.attack_damage", 2.0D);
        DEFAULT_ATTRIBUTES.put(EntityTypes.CHICKEN, EntityInsentient.p().a(base).a());

        this.setPosition(loc.getX(), loc.getY(), loc.getZ());
        this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, false));

        this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<EntityHuman>(this, EntityHuman.class, true));
    }
}
#

Constructor constructor;
and
base = (AttributeBase) constructor.newInstance("minecraft:generic.attack_damage", 2.0D);
are surrounded in try/catch with stacktrace printing but I had to remove it because discord doesn't allow messages that long

latent rock
#

atm we're paying something like $110/mo for shared hosting on a 7700k and a 3600x
@dreamy dawn 110? Get OVH dude

dreamy dawn
#

Yep, we're currently looking into dedicated hosting

stoic shell
#

What's going wrong here?

lethal steeple
#

Hey how do I install plugins in a Ubuntu server?

cursive umbra
#

Yo if anyone can help me add plugins to my minehut server that would be great. @ me. rn i have deathcoords veinminer voidspawn but i want to add one where i can tp to a warp and tpa

lone fog
#

No need to post in both channels

stuck quartz
#

is there a way to save some information in a inventory that i created?

#

so when a player clicks some item on the inventory some event uses the saved information

lone fog
#

You can use the persistentDataContainer on the item

median bridge
#

I'm in some need of help! Currently my team and I are working on updating our server to 1.16.1 and we ran into a problem. Multiverse does not support 1.16 and we need that too transfer between worlds. I read an article about how Spigot is experimenting with multi world support, but there was no further info. I'm hoping someone can help me out with this, that would be much abliged.

grim halo
#

@stuck quartz There are several things you can do in order to make data accessible.
One way would be saving the data in the PersistentDataContainer of the item. I dont really like that approach as it makes it harder to
maintain the same GUI for multiple people.
If you have to store information inside of a inventory then your data structure might be messy.
Why do you need to save something in the inventory?

#

@median bridge You have 2 options:

  • Wait till multiverse updates
  • Write your own sollution
median bridge
#

Thank you for the strait forward answer, I was worried that would be the case, but we will try our best to make with work 😁

grim halo
stuck quartz
#

i'm making a plugin to secure chests, and it saves data on the sign with PersistentDataContainer
i made PlayerInteractEvent create a inventory with a item with it whenever you right click the sign
and InventoryClickEvent is being used to handle whenever the player clicks the item
and both of these events are in different java files
when you click the item, a value in the PersistentDataContainer on the sign should change

the problem is that i don't know how i could get the Block of the sign so i can change the value

median bridge
#

@grim halo on the Spigot page it says it supports up to 1.15

grim halo
#

*he didnt test it for 1.15. Load up local server and try it.

median bridge
#

Ok

#

We are gonna give that a try, ill get back to you on if it works or not

cursive umbra
#

Yo if anyone can help me add plugins to my minehut server that would be great. @ me. rn i have deathcoords veinminer voidspawn but i want to add one where i can tp to a warp and tpa

grim halo
#

@stuck quartz This sounds like you should have a wrapper for your GUI.
Simple solution:

  • Create a Map<Inventory, Sign> as soon as the inventory is created.
  • InventoryClickEvent -> get sign from map -> change sign.

Proper solution:

  1. Create a class "LockGUI" (or something)
    This class inherits the Sign as well as the Inventory.
    It has a constructor where you pass the inv and the sign.
    It also has a method that handles clickevents.
  2. Create a manager class that inherits a Map<Inventory, LockGUI>
    On inv click -> check if inv is in map -> if yes pass event to LockGUI instance
#

@cursive umbra EssentialsX

stuck quartz
#

thanks, ill try that

cursive umbra
#

can u helop e set it up

grim halo
#

Uhm. No? What do you mean by "set it up". Go on the plugin page of essentials.
They have a whole wiki explaining every config line in detail.

cursive umbra
#

i not good with this stuff and adding it

#

or whatever and y friends told me i have to set it up

#

i tried doing y self and vids

#

but i dont get it

#

thats why

grim halo
#

Im sry but you will have to learn that. It might be hard in the begining but you wont improve without trying.
Asking others to do it for you is a shortcut and wont help you in the long run.

cursive umbra
#

nah like guide me through it

#

and i can screen share

lone fog
#

That’s what the documentation does

#

And probably YouTube videos too

grim halo
#

Ok do you know how to upload the plugin to your server?

cursive umbra
#

no

#

and not to make it with warps all that

grim halo
#

How did you get the other plugins then?

cursive umbra
#

the list from website

grim halo
#

Just looked at minehut. Looks trash af... but ok its free.
Can i see the list of plugins that are accessible?

cursive umbra
#

huge list

#

18 pages

stuck quartz
#

@grim halo what did you meant by It also has a method that handles clickevents
i didnt understand that exactly, sorry

#

what do you mean by method

#

its like a function?

#

im sorry im just tired and its been long since i used java

grim halo
#

In your LockGUI you have a method called like:
public void handle(InventoryClickEvent event);
That handles the event.
Then from your Listener class (where you obvsly need an instance of your manager)
you get the gui and call the method something like:
gui.handl(event);

stuck quartz
#

ooh

grim halo
#

Yes functions in Java are called method

stuck quartz
#

ok, thanks a lot

cursive umbra
#

huge list
18 pages

frigid ember
#

Can anyone help me with installing Java 8 to a vps?

grim halo
#

Yes. Huge list. We got it. Search for essentials and install it

#

@frigid ember What os?

frigid ember
#

Virtual private server

#

sec

grim halo
#

i got that.

frigid ember
#

lol

grim halo
#

What (os = operating system)

frigid ember
#

ik gimme a sec

#

forgot it

#

Debian

grim halo
#

Ok. First update your apt list with
apt-get update

cursive umbra
#

ok

latent rock
#

EYE_OF_ENDER is the correct spigot name right

frigid ember
#

k

grim halo
#

Wait do you have sudo?

frigid ember
#

yes

grim halo
#

then its sudo apt-get update

frigid ember
#

okay

#

Wait

#
Err http://http.debian.net jessie-backports/main amd64 Packages
  404  Not Found
Ign http://http.debian.net jessie-backports/main Translation-en_US
Ign http://http.debian.net jessie-backports/main Translation-en
W: Failed to fetch http://http.debian.net/debian/dists/jessie-backports/main/bin                                                                                                                                                             ary-amd64/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used                                                                                                                                                              instead.
grim halo
#

weird. ignore it

frigid ember
#

okay

grim halo
#

sudo apt-get install oracle-java8-installer

frigid ember
#

E: Unable to locate package oracle-java8-installer

keen compass
#

@wind dock service name should be the same name as the subdomain you assign for it. Protocol is TCP

grim halo
#

Uhm wait... java 11 is the new default right?

frigid ember
#

yes

grim halo
#

sudo apt update

latent rock
#

What's the spigot name for ironbars

frigid ember
#

Same text

grim halo
#

sudo apt install apt-transport-https ca-certificates wget dirmngr gnupg software-properties-common

frigid ember
#

as before

#

k

#

K done with that

cursive umbra
#

ESSENTAILX?

grim halo
#

wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -

#

@cursive umbra yes

frigid ember
#

says "OK"

grim halo
#

sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/

frigid ember
#

okay

lone fog
#

Also IRON_BARS

frigid ember
#

it didn't say anything

grim halo
#

again sudo apt update

frigid ember
#

okay

grim halo
#

sudo apt install adoptopenjdk-8-hotspot then check your version with java -version

frigid ember
#

k

#

Build 1.8.0

#

Is that 8??

grim halo
#

_25x something?

frigid ember
#

openjdk version "1.8.0_262"

grim halo
#

Yes now you got java 8

frigid ember
#

OMG Thanks

#

Took me hours

grim halo
#

But why would you ever downgrade?

frigid ember
#

Cause Spigot Most Versions Only Work Java 8

#

And Bungee

#

Or It Wasn't Working For Me

lone fog
#

Go ask Mojang why they still bundle java 8 too :p

#

8_52 at that

grim halo
#

Wait... my Spigot runs on Java 14.0.1 what version are you using?

frigid ember
#

14

#

Idrk

#

But thanks

grim halo
#

kk

stuck quartz
#

@grim halo now i'm wondering, when should i create the class and handle it?

#

i made the code for the class

#

if i created it whenever a player creates a sign it wouldn't matter, as the instance would be gone when the server stopped

grim halo
#

You create one instance of your manager in the onEnable. The reference to this one instance is going to be passed to everything that needs to interact with
the inventories. The manager should handle the creation and destruction of the inventories.
on sign click -> manager.openLockGUI(Player player, Sign sign) -> internally that creates a new Inventory and puts it in the map with its wrapper <Inventory, LockGUI>
on inv click -> pass event to manager -> internally the manager checks if inv is in map -> if yes -> get the LockGUI and let it handle the event
on inv close -> call manager.destroy(Inventory inv) -> internally this should delete the inv from the map

#

Manager classes always have on single instance.

solar igloo
#

uhh small question - does PlayerTeleportEvent happen every time PlayerChangedWorldEvent happens?

grim halo
#

No idea... write a quick listener and test it out ^^

cursive umbra
#

smile

#

what do i do now

#

@grim halo

keen compass
#

@solar igloo yes it happens every time they change worlds

grim halo
median bridge
#

@grim halo The multiworld plugin works for us, Thank you so much

grim halo
#

np

#

Ill tell him he can add 1.16 as tested ^^

frigid ember
#

How do i uninstall java?

#

on a vps

#

i already had 11 on 1 and i want to downgrade

grim halo
#

Whats wron now?

frigid ember
#

nothing

#

had a vps with 11 java

#

and want to uninstall

#

to downgrade

#

cause i cant do it when i have java already

grim halo
#

Just delete the /usr/lib/jvm/jdk-11 something/ folder

sudden elk
#

Hey! I have 4 integers, how do I order them from highest to lowest

frigid ember
#

alr

grim halo
#

Are the ints in some sort of collection?

sudden elk
#

No

grim halo
#

You could do something with Integer.min(x, y) gets you the lowest of both.
Or Collection.sort(new ArrayList<>(ia, ib, ic, id))

sudden elk
#

rightio would that sort from highest to lowest?

grim halo
#

not sure. But you can iterate incrementally or decrementally so it doestn rly mattert

#

You can start to iterate from each side of the list

frigid ember
#

Hey umm

#

Got that

#

When i deleted it

#

And tried to install

grim halo
#

You can slo just do this:

        int[] arr = {13, 7, 6, 45, 21, 9, 101, 102}; 
  
        Arrays.sort(arr); 

Will sort you the array of ints

sudden elk
#

ah rightio

#

then will that sort the int[] so then I can do int[0] etc

frigid ember
#

Its not letting me install java -_-

#

Need help please

tiny dagger
#

i'm not sure what you want us to say

#

install it better?

frigid ember
#

I need help

tiny dagger
#

uninstall everything

#

run in admin mode

frigid ember
#

Wym everything?

tiny dagger
#

java related

frigid ember
#

Its a vps i'm not sure u can do that

#

@grim halo can u help me?

#
root@<ip>:~# java -version
-bash: /usr/bin/java: No such file or directory```
#

I get that when i do java -version

#

when i do sudo apt install adoptopenjdk-8-hotspot it doesn't do anything

#

it says

#

Reading package lists... Done
Building dependency tree
Reading state information... Done
adoptopenjdk-8-hotspot is already the newest version (8u262-b10-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
grim halo
#

You have java 8 installed. Whats the reason you want uninstall the other version?

frigid ember
#

It was 11

#

This is a different vps btw

#

but when i do java -version how come nothing shows up?

grim halo
#

Wdym nothing shows up? You either get the version or "bash java command not found" or something like this

frigid ember
#

k

#

it like says

#
root@<ip>:~# java -version
-bash: /usr/bin/java: No such file or directory
#

Cant start my mc server up

#

Java isn't a thing

#

when i install it it doesn't install

grim halo
#

No idea what this server went through but that happens if you install i386 java on a 64bit machine.
Im not sure i wanna touch that.

  1. uninstall everything java related.
  2. reinstall java 8
frigid ember
#

k

grim halo
#

Or... wait

graceful vigil
#

poor server

grim halo
#

you can try one more thing

frigid ember
#

what?

grim halo
#

sudo update-java-alternatives -a

frigid ember
#

awk: fatal: cannot open file `/usr/lib/jvm/*.jinfo' for reading (No such file or directory)

grim halo
#

did you check if the directory exists?

frigid ember
#

Imma just reinstall the vps ffs

#

and then do what u told me

graceful vigil
#

why don't you get shared hosting or hire a sys admin?

frigid ember
#

cause

#

idrk

graceful vigil
#

If your server is small, it's more cost effective to just get shared hosting anyways (plus it saves all the hassle of managing the entire backend). If your server is already large, or it will use a lot of resources, then you should just hire a sys admin anyways

frigid ember
#

Well idk its my first time and i'm just trying things out

graceful vigil
#

If it works Β―_(ツ)_/Β―

grim halo
#

I think its a good introduction for dedicated servers.
You have to start somewhere

graceful vigil
#

That's true

frigid ember
#

Alright Got Java

#

Thanks For The Help Btw

red zenith
#

Did you start over from scratch with a new instance?

pastel condor
#

What happens if my server looses connection to the database, does spigot have a query feature?

#

Or local caching?

tiny dagger
#

which type of database?

pastel condor
#

Oh um what about my luck perms connected to my remote Maria DB server?

tiny dagger
#

ofc not

#

that's up to the luck perm plugin

pastel condor
#

Oh okay

#

Any recommendations for remote databases?

#

Like to ensure there’s no disconnection?

arctic hound
#

Can someone help me, if I stop my server it also hangs and will not be stopped
Stopping server Ignore any thread death message you see! Mc-Version 1.15.2

fleet crane
#

when i do sudo apt install adoptopenjdk-8-hotspot it doesn't do anything
@frigid ember tbh best to use your distros openjdk where available

#

that message is not from spigot, must be your panel

tacit trellis
#

How can I make a spigot fork and add player.getLevel()? How can I set the level of the player on join by getting it from a mysql database?

fleet crane
#

I'm like 99.9% sure you dont need a fork for this

tacit trellis
#

I know

fleet crane
#

why would forking spigot be your first reaction

tacit trellis
#

But that is just 1 of the things I need

sinful spire
#

wouldn't player.getLevel() get players xp?

tacit trellis
#

It isnt

fleet crane
tacit trellis
#

Yes but something else then

sinful spire
#

yeah

fleet crane
#

yeah there's literally getLevel already

tacit trellis
#

player.getServerLevel()

fleet crane
#

wtf is serverLevel

sinful spire
#

he wants to make a levelling system

tacit trellis
#

your experience level on a server?

sinful spire
#

why not just a hashmap

wraith thicket
#

That's literally what a plugin is for ...

tacit trellis
#

lkeny'w

#

thanks

#

I know htat

fleet crane
#

then what are you trying to do

tacit trellis
#

add all my methods to spigot fork

fleet crane
#

why

tacit trellis
#

why not

wraith thicket
#

Because it's a terrible idea

fleet crane
#

^

tacit trellis
#

why is it terrible?

wraith thicket
#

You'd have to keep maintaining your fork every time there's an update

#

There's simply no need for it.

tacit trellis
#

no

sinful spire
#

yeah

tacit trellis
#

my server will always be 1.8

fleet crane
#

but why would you do this

sinful spire
#

ouch 1.8

fleet crane
#

its worse than doing it the proper way in every conceivablemanner

#

spigot is literally designed so you dont do this

tacit trellis
#

okay guess not then

wraith thicket
#

The use case you're describing is exactly why the plugin system exists...

tacit trellis
#

but can I still know 1 thing

#

is it possible to use events when forking spigot?

sinful spire
#

why wouldn't it be

fleet crane
#

but again why

tacit trellis
#

its easier for a network?? idk thats why i was going to do this but maybe im wrong

fleet crane
#

no, its much harder

tacit trellis
#

but like once you have it you can easily do sutff like player.getLevel and player.addLevel

fleet crane
#

but those methods literally already exist

tacit trellis
#

yyeyss i know

#

but ill rename them then

tacit trellis
#

by level I mean like server level not minecraft elel

#

woooow

sinful spire
#

wait, does discord remove links from gifs now?

tacit trellis
#

yes

#

from images too

sinful spire
#

nice

tacit trellis
#

okay thanks for your help

sinful spire
#

drowned

fleet crane
#

who lives in a pineapple under the sea"?

vernal spruce
#

that guymd_5

bronze acorn
#

spongebob turned into a

#

nevermind

timber thorn
#

Hey guys, hoping somebody can help me here

#

I am having an issue with items' names not being displayed properly for no apparent reason and without any exceptions being thrown

#

Specifically the ItemMeta.setDisplayName(...) method does not seem to work properly or something and I cannot figure out the pattern of when it works and when it doesn't

grim halo
#

Thats weird... dou you have any plugin intercepting your item packages?

timber thorn
#

No nothing of the sorts

#

So jsut as an example

fleet crane
#

did you remember to call setItemMeta

wraith thicket
#

Have you made sure to set the item's meta? Have you made sure to set the item to the specific slot you're talking about?

vernal spruce
#

I mean throw the code

timber thorn
#

This works:
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&r&e&l>&m= &e&l&m &r &r&7&lSwordΒ§f &r&e&l&m &r&e&l&m "));

This doesn't:
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&r&e&l>&m= &e&l&m &r &r&7&lSwordΒ§f &r&e&l&m &r&e&l&m =&e&l<"));

vernal spruce
#

friendly reminder doing item.getItemMeta.setdisplayname wont actually set it

sinful spire
#

oh god thats a lot of formatting

timber thorn
#

I know I know, not my first rodeo, I am setting the item meta properly

vernal spruce
#

holy shit thats alot ofc color codes but shouldnt be an issue

#

whats that though

#

Β§

timber thorn
#

No the number of color codes is not an issue, im trying to make a stylized item title

vernal spruce
#

that might give a error

#

this shouldnt exist in a name 'Β§'

sinful spire
#

oh yeah, Β§f

#

but that would just change it to white i think

vernal spruce
#

might outright make it not work

#

as it cant recognize it

timber thorn
#

No that's not the issue, if you look at the output of the translateAlternateColorCodes(...) method, it just converts all those & to Β§ symbols anyhow

grim halo
#

Β§f is the proper way to set color. &f -> translate alternate color just replaces the 'Β§' with '&'

vernal spruce
#

yeah but were not supposed to use

#

Β§ in this way

timber thorn
#

No you're right, that was a copy-paste error on my part

#

anyhow it's not the reason it doesn't work

#

And the funny thing is in the chat both of them work

vernal spruce
#

have you tested without it?

timber thorn
#

yes

#

just now

vernal spruce
#

hmm what version

timber thorn
#

1.16.1

#

In 1.15.2 it all worked as expected

#

I updated to 1.16.1 and all my plugin's item titles just broke

vernal spruce
#

might have something to do with the new color system

grim halo
#

Whats the reason 'Β§' shouldnt exist in a name and why.

vernal spruce
#

There have been already alot of threads about this issue

lament sonnet
#

How do i make a forum post on the spiggot website?

vernal spruce
#

@timber thorn try removing the f letter

timber thorn
#

might have something to do with the new color system
@vernal spruce I thought that too, but what speaks against that theory is
a) it works when I just leave out this tiny portion: "&e&l<" and
b) when I look at the item descriptor string the Name seems to be there correctly with "display:{Name:'{"extra":[{"bold":true,"italic":false,"underlined":false,"strikethrough":fa ... bla bla... "

vernal spruce
#

and see what it does

sinful spire
#

right, they added hex colors to texts, maybe thats really why

vernal spruce
#

remove the f or replace it and try again

timber thorn
#

remove the f or replace it and try again
@vernal spruce I just did, makes no difference

vernal spruce
#

as the colorcode might pick it as a hex color

sinful spire
#

try changing the & to # because that worked for someone before

vernal spruce
#

idk then never had an issue with the colors

grim halo
#

Is DuckDuckGo down for you guys?

old plume
#

Someone know a working way to unregister an advancement? Bukkit.getUnsafe().removeAdvancement(key); does nothing

lament sonnet
#

nope

grim halo
#

I have problems searching

vernal spruce
#

@timber thorn guess try getting it from a config

sinful spire
#

down for me

lament sonnet
#

nope its down for me

vernal spruce
#

see if getting it rather than hardcoding it works

sinful spire
#

probably cf again

tiny dagger
#

yup

timber thorn
#

idk then never had an issue with the colors
@vernal spruce I don't know if it's something to do with the colors to be honest...

vernal spruce
#

i mean i clearly didnt use 10 different color codes in 1 word..

timber thorn
#

it just looks wild in this raw format tbh

#

can I post pictures somewhere on the discord to show you?

vernal spruce
#

verify ten post them here

sinful spire
old plume
#

No one? -> Someone know a working way to unregister an advancement? Bukkit.getUnsafe().removeAdvancement(key); does nothing. It register correctly with Bukkit.getUnsafe().loadAdvancement(..) and i can award it also. Basically i'm making a system to send custom message from here, it works, but i have to register different name for different messages. that's not the clearest thing to do

timber thorn
#

&e&l<&r&e&l&6 ✦ &r&e&l>&m= &e&l&m &r &7&lSword&f &r&e&l&m &r&e&l&m =&e&l<&r&e&l&6 ✦ &r&e&l>

#

This is what that colorcode amounts to

#

Nothing special or fancy

#

and it worked perfectly fine in item names in 1.15.2

grim halo
#

Did you make sure your class is UTF8 encoded?

timber thorn
#

But not it just pretends that there is no custom item name there and calls the item by the localization specific name of the server.

#

Did you make sure your class is UTF8 encoded?
@grim halo It should be, yes. Idk how to verify but if you are referring to the ✦ symbol, it renders fine in the game as well...

#

One half works

#

if I add the other half, it breaks

sinful spire
#

so its not the star symbol then

timber thorn
#

and it doesn't seem to matter which half

sinful spire
#

maybe the double &e&l-- somehow?

timber thorn
sinful spire
#

what

timber thorn
#

So I know that the syntax of the code is not the issue

sinful spire
#

or maybe its just too long for a item

#

try without the color

timber thorn
#

And it just doesn't make sense

sinful spire
timber thorn
sinful spire
#

wtf

timber thorn
#

That is more than 35 πŸ˜‰

sinful spire
#

ok so that source is fake, but why doesnt it work

timber thorn
#

hm
@sinful spire Where did you get that 35 limit from?

sinful spire
#

thats probably only for anvil πŸ˜„

timber thorn
#

Oh also works in color btw

#

I really tested everything I could think of to be the cause but nothing makes sense

#

So the thing is that the NBT item descriptor has the correct and complete name saved, I really thing this has to do with parsing the item and displaying the name somehow

marsh hawk
#

anyone know how to let the player walk on water without being glitchy?

timber thorn
#

Could somebody maybe try this line of code on one of their servers and see if/how that works?

grim halo
timber thorn
#

How

#

why

#

what?!

sinful spire
#

anyone know how to set honeyLevel of a bee?

grim halo
timber thorn
#

This is the exact same code man...

sinful spire
#

no

#

you dont have it as a string

#

try that maybe

timber thorn
#

How do you mean I don't have it as a string?

#

oh the name?!

sinful spire
#

yeah

old plume
#

So, no one have or know a working alternative to Bukkit.getUnsafe().removeAdvancement(key); ? Or maybe i'm using it wrongly

sinful spire
#

seems maybe thats a problem

grim halo
#

That should literally make no difference...
Maybe he has an older spigot version. Try updating

#

Oh ok... i used Paper -> works perfectly fine
switched to Spigot -> broken

timber thorn
#

No that makes no sense @sinful spire because the translate method returns a string. makes no difference if I save it beforehand or not

sinful spire
#

so seems like thats a spigot problem then 7smile7

grim halo
#

yep

timber thorn
#

Well crap, yeah so it seems to be a spigot bug after all

#

What's the proper way to report it?

#

Never done a bugreport

sinful spire
#

i'll try it on CraftBukkit hah

timber thorn
#

i'll try it on CraftBukkit hah
@sinful spire Please do! ❀️

grim halo
#

Ping md5 and yell at him. Post your code. He likes that

timber thorn
#

Who is md5?

sinful spire
#

violate the eula

#

wow

grim halo
#

Had the same thing...

old plume
#

@fleet crane Any idea why Bukkit.getUnsafe().removeAdvancement(key); doesn't unregister the advancement? Thanks

#

let's see

grim halo
#

What do you mean who is md5? Its a cryptographic hash function.

timber thorn
#

What do you mean who is md5? Its an cryptographic hash function.
@grim halo How do you yell at a cryptographic hash function? πŸ˜„

#

Ping md5 and yell at him

#

No but who is md_5? A spigot dev?

sinful spire
#

hey@md_5#0001 who are you

marsh hawk
#

no need to spam ping him

tiny dagger
#

md5 is naked 8548ab3986b7eb8d294bb0208442039a

#

decrypt that

timber thorn
#

rofl that's why I didn't want to ping him in the first place

sinful spire
#

i didnt ping him

timber thorn
#

No need to bother good folk with my earthly spigot bugs and problems

grim halo
#

The proper way is posting a jira bug report

timber thorn
#

Cool, do I need a jira account for that?

#

Or do I use my spigotmc credentials?

kindred bay
#

Hiii, i have a little problem on Eclipse, i wanna use the AutoCompletion but it doesnt works, maybe a problem with the spigot javadoc, if someone can help me πŸ™ 😭

timber thorn
#

Hiii, i have a little problem on Eclipse, i wanna use the AutoCompletion but it doesnt works, maybe a problem with the spigot javadoc, if someone can help me πŸ™ 😭
@kindred bay What does it do instead of working? What's happening exactly?

kindred bay
#

Eclipse doesn't offer me anything 🀷 @timber thorn

grim halo
#

Eclipse doesn't offer me anything 🀷 @timber thorn
@kindred bay That sentence has more truth in it than you know

timber thorn
#

@kindred bay Check out the settings in Window->Preferences->Java->Editor->Content Assist->Advanced

#

What you probably want are the Template Proposals

#

@kindred bay That sentence has more truth in it than you know
@grim halo Lol πŸ˜„ Are you using CLion?

grim halo
#

CLion? Only when i do embedded stuff. C/C++

timber thorn
#

No what's the jetbrains IDE for Java called?

kindred bay
#

@timber thorn marry me

timber thorn
#

I seem to have forgot the name

bold anchor
#

IntelliJ lol

grim halo
#

IntelliJ ?

timber thorn
#

@timber thorn marry me
@kindred bay Buy me a drink first then we can talk

kindred bay
#

it worked

#

😭

timber thorn
#

Yes that's it xDD

bold anchor
#

Why did you lol at IJ?

#

Are you one of those eclipse plebs?

timber thorn
#

I remember I tried switching to IntelliJ from Eclipse and I loved it, absolutely prefer it to Eclipse.

#

But I could not get hotswapping to work

proper cairn
#

Is there any sources or at least a way to look at the spigot API source code?

grim halo
#

@proper cairn Run BuildTools. It installs everything in your maven repo

bold anchor
#

Using buildtools

timber thorn
#

Im derping...

#

Yeah so I love IntelliJ but I could not get hotswapping to work and with some Ant builders in eclipse, you can start the spigot server from within eclipse and hotswap your code so you don't have to restart the server any time you change something in your classes. Could not get that to work in IntelliJ so I stuck with Eclipse

#

I mean it's not that bad to be honest, just doesn't look as good

bold anchor
grim halo
#

I love intellijs autocompletion and plugins. Also version control integration is great... and maven... and there is mcdev for intellij...

bold anchor
#

IntelliJ is a wet dream

proper cairn
#

What do i run specifically with build tools? I really dont work with Maven

timber thorn
#

Thanks for the link though

timber thorn
#

i'll try it on CraftBukkit hah
@sinful spire Did it work on CraftBukkit by any chance?

sinful spire
#

nope

#

forgot to type it sorry

#

but it doesnt seem to work

timber thorn
#

Right, ty anyhow. I created a jira bugreport πŸ™‚

frigid ember
bronze acorn
#

i believe TextComponent#getText() returns a string but idk if its a json string or a normal string

wraith thicket
#

BookMeta#setPages sets the pages as you enter them. In text form

frigid ember
#

and how can i solve it?

wraith thicket
frigid ember
#

yes

#

I look at it before

#

but idk how to set that into it with text without hover event and with

wraith thicket
#

You've already got the TextComponent - just pass that

#

You'll have to provide all the lines as components, of course

frigid ember
#

i want one part without text compenent and one with

#

yes

#

i know

#

but i dont want that

wraith thicket
#

That's the only way you can do it.

#

And there's no difference between simple text and simple text simply wrapped into a TextComponent

#

They get displayed exactly the same way

frigid ember
#

so i need to create second textcomponent without hever and click event?

wraith thicket
#

You'll need one for each line, yes

frigid ember
#

and how to set it into that book?

#

i need BaseComponent[] ?

wraith thicket
#

No, you can simply pass separate instances

frigid ember
#

how

#

im not american/uk

wraith thicket
#

(arg1, arg2)

frigid ember
#

i dont undersatnd

wraith thicket
#

The ... denotes varargs

#

You know how to pass arguments to a method, right?

#

You've got TextComponent arg1, arg2;

#

You pass them as spigotMeta.setPages(arg1, arg2)