#help-development

1 messages ยท Page 1419 of 1

gusty bough
#

Both didn't work

eternal oxide
#

Show some code as it works here just fine

gusty bough
#

ScoreboardManager sm = Bukkit.getScoreboardManager();
Scoreboard board = sm.getMainScoreboard();
team = board.registerNewTeam(team_name);
team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
team.addEntry(player.getName());

#

And i add both players

slate pendant
#

Sorry for another question, but is there a way to change block properties from plugin like using the debug stick?

eternal oxide
#

Looks fine. You should never collide with any team

gusty bough
#

But it doesn't work and idk why

eternal oxide
#

sec

#

starting ide

gusty bough
#

Do spigot needs something on true maybe?

eternal oxide
#

1.16.5?

gusty bough
#

1.16.5 server

#

yes

sleek pond
#

?

#

eula

#

all mc servers need eula

eternal oxide
#

?paste

queen dragonBOT
eternal oxide
quaint mantle
#

How do i add a item to an inventory?

Inventory inv = Bukkit.getServer().createInventory(null, 27, "ยง9Links").addItem(DiscordItem.Discord)
eternal oxide
#

inv.addItem

quaint mantle
#

ok ty

eternal oxide
#

addItem doesn;t return an Inventory

quaint mantle
#

alr

#

anybody knows

#

whats wrong

#

i tried also

#

when i open the inv

#

the items arent there

eternal oxide
#

what is six, seven ?

#

are they pre created ItemStacks?

quaint mantle
#

yes

#

maybe its cuz of the material

#

"Command" xD

eternal oxide
#

yeah, COMMAND isn;t a possible ItemStack

quaint mantle
#

its

#

not

#

that

#

i tried

#

with

#

SIGN

young knoll
#

Those are legacy materials

wraith rapids
#

COMMAND is the old material name for the command block yeah

quaint mantle
#

yes

#

i know

#

but why arent the materials

#

in the inv

torn oyster
#

how would i add player health in playerlist

#

rn its this

wispy monolith
#

normal vanilla commands

torn oyster
#

but i want it like this

#

no i literally have a scoreboard system for this

#
        Objective h2;
        if (board.getObjective("showhealth2") == null) {
            h2 = board.registerNewObjective("showhealth2", "health");
            h2.setDisplaySlot(DisplaySlot.PLAYER_LIST);
            h2.setDisplayName("" + ChatColor.YELLOW);
        } else {
            h2 = board.getObjective("showhealth2");
        }```
#

this is my code

#

i have one above name

#

and in playerlist

torn oyster
#

uhh i don't think 1.8 has that

#

lol

ivory sleet
#

reflection time big boy

chrome beacon
#

Or update

torn oyster
#

i am not updating

chrome beacon
#

It's time to move on

torn oyster
#

my entire playerbase plays on 1.8

#

and my server is entirely based around 1.8

wispy monolith
torn oyster
#

wdym

#

maven?

#

or am i dumb

wispy monolith
#

do u use maven?

torn oyster
#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>```
#

yes

#

thatss it

#

if thats what u mean

wispy monolith
#

ig this is fine

#

try importing the spigot api

torn oyster
#

do i change it from spigot to spigot-api

#

or do i add an entirely new one

wispy monolith
#
       <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
#

add this as a new one

#

and try

#

if it works

torn oyster
#

do what

wispy monolith
#

add this to ur pom.xml

torn oyster
#

yeah ik

#

but what do i try

wispy monolith
#

under the dependencies

torn oyster
#

i know

#

i have done that

#

what do i try

wispy monolith
#

try using the thing that didn't work for u

torn oyster
#

well it doesnt even exist

wispy monolith
#

even in the spigot-api?

torn oyster
#

yes

wispy monolith
#

so... rip

young knoll
#

spigot has spigot-api

#

So there is no reason to have both

torn oyster
#

how do i do it

spring river
#

I've multiples identical ItemStack (same name, same lore, same Material, ..) so they have the same hashCode. Is there an hidden tag i can used to get differents hashcode between my items stack please (to be able to use .removeItem to delete the specific item) ?

chrome beacon
#

Decompile some classes and look around

wraith rapids
#

no, not without making the items unstackable

#

if unstackable items are fine, add a UUID into the persistent data container of the ItemMeta of that item

#

and that will make the stack unique

#

it won't stack, but you can target it specifically with removeItem and similar

spring river
#

but where can I add something into data container of ItemMeta ?

spring river
#

Ok thx ๐Ÿ˜„

#

Have a nive day !!

eternal oxide
#

Was there a recent update/change to Scoreboards? It seems registering teams to the Main scoreboard now throws an already registered error

#

wasn;t happening a couple of days ago

cold field
#

How can you abuse?

sullen marlin
#

Nope, no changes in months if not years

eternal oxide
#

odd but ok

gusty bough
#

even with the code you gave me i cannot deactivate collisions between players x)

eternal oxide
#

Odd. You saw it working on the demo server I ran up

gusty bough
#

Mhh yeah but did you activated collisions?

#

on spigot yml

eternal oxide
#

enable?

gusty bough
#

yeah

#

go on ur server and test without teams

eternal oxide
#

I see no entry in spigot yml for collisons

wraith rapids
#

that's on paper

#

which does it through teams as well

#

because player collisions are client side

#

and the only way to disable them is to set the players in teams with the collision rule off

eternal oxide
#

So default with Spigot collisions are default on

gusty bough
#

With teams i can achieve no collisions between me and other entities (but not others players)

#

like me and a villager

eternal oxide
#

Well I'm afraid I can;t test for you at the moment. I seem to have broken team registration on the Main scoreboard somehow

gusty bough
#

Do you have same bug?

eternal oxide
#

No

gusty bough
#

It says main scoreboard is null

#

when i want to add players to the scoreboard...

eternal oxide
#

I'm having an issue registering any team on the Main scoreboard. It complains that the team name is already registered

#

Which has me stumped as I've changed no code I can think of

#

very odd. It was working when I tested collisions now no scoreboard team registration works

#

well, no registration on the Main board

gusty bough
#

Honestly these teams systems are fucked

eternal oxide
#

looks like I corrupted somethgin in my world files

#

Oh my, Teams are persistant?

young knoll
#

Probably

#

They are in vanilla

eternal oxide
#

yep, they persist through server starts

wild wharf
#

Hey, I'm working on a custom plot system and I cannot wrap my head around how to figure this out

#

Basically, I want to have a method that takes in an X, Y coordinate and finds the next coordinate in this sequence https://prnt.sc/12jlk2b

Lightshot

Captured with Lightshot

spare mason
#

anyone can help me

#

java.lang.UnsupportedClassVersionError: me/TheWood/org/Main has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 52.0

#

idk how repair this

eternal oxide
wild wharf
#

Yeah I know lol

eternal oxide
#

I can;t see any simple logic to it

#

a spiral would be simpler

wraith rapids
#

logarithms and shit

#

side length 1 spans index 0, side length 2 spans indices 1 through 4, side length 3 spans indices 5 through 8, side length 4 spans indices 9 through 16, etc

#

or actually looking at it that's totally wrong

#

could just find it iteratively i guess

#

find the floor of the square root of the index and you'll get the side length, then check whether you're past halfway to the square of the next integer

#

then xor with side length % 2

#

and throw a few more xors and %2's at it and you'll probably get there

eternal oxide
#

The real question should be, Why do you want to trace this pattern?

wraith rapids
#

it looks kewl i guess

random epoch
wraith rapids
#

or compile for a lower version

spare mason
#

It don't work help

#

what i need to change

wraith rapids
#

the version

spare mason
wraith rapids
#

read

#

use a translator if you can't

spare mason
#

idk what do you mean with the version

#

the version of what

wraith rapids
#

JAVA version

spare mason
#

no, this I already repair

rotund pond
#

Hello guys !
I'm trying to create more complete configuration files than usual to me, and I'm having a problem.
How can I get all the sections back?
In my example, it will be all "whiteGlassPlane", "lightBlueGlassPane" etc ...

I want these sections to have a user configurable name, and this is where my problem lies: /
other than brute force and testing for all characters ... xD

Thank you for your time

spare mason
#

I change to java 1.8

#

but when

wraith rapids
#

get the section and call getKeys on it

spare mason
#

in the chat say spawneando un whiter skeleton no spawn any

wraith rapids
#

it'll return a list of all the sub-sections and keys in it

#

f.e if you get the decoration section, and then call getKeys on it, you'd get the elements you listed in your example

rotund pond
#

Ah !
Keys !!
That's what i was looking for, but i didn't know these were called "keys"
Thank you dude โ™ฅ
Last question: the method is getKeys(boolean arg) ... What is this boolean ?

wraith rapids
#

whether for the get operation to be shallow or deep

#

getKeys(true) will return every key and every key of every sub section and so on

#

getKeys(false) only gets the keys in the level immediately below

rotund pond
#

OH Well, i'll use getKeys(false) so xD
Thank you again ๐Ÿ™‚ โ™ฅ

stable stone
quaint mantle
#

how would i do something like this:
(this is not correct code it just is an example of what im looking for)

if (inv.getItem().equals(ItemStack.item).isLeftClicked()) {
                p.closeInventory();
            }
#

Did you make that plugin?

spare mason
#

any person can help me plz

#

don't work

quaint mantle
#

because you might want to ask this in #help-server @stable stone

sage swift
#

also your brackets are fucked up

quaint mantle
spare mason
sage swift
#

?paste holy shit

queen dragonBOT
sage swift
spare mason
wraith rapids
#

you need to put english inside your head

sage swift
#

you need to spawn the entity, not ecall mpty methods

#

nice

wraith rapids
#

trying to help someone who can't understand anything you say is the most annoying thing ever

quaint mantle
#

how would i do something like this:
(this is not correct code it just is an example of what im looking for)

if (inv.getItem().equals(ItemStack.item).isLeftClicked()) {
                p.closeInventory();
            }
wraith rapids
#

&&

#

if (condition1 && condition2)

quaint mantle
#

ok ty

subtle vector
#

how do i show the damge i dealt to an enemy when i hit them with a sword like if i hit a zombie it shows the damage. idk where is shows it could be in chat,console or whatever?

wraith rapids
#

if you want to be fancy, show it in a hologram like in old school rpgs

sage swift
#

EventPriority.MONITOR and getFinalDamage or whatever it is

quaint mantle
#

to remove something from config

#

do you just set("test", null)

wraith rapids
#

that will remove test and everything keyed under test

quaint mantle
#

thank you very much ๐Ÿ˜„

quaint mantle
#

It's actually not removing

#

the thing

#

the path stays there

#

but the data is gone tho

timid rose
#

I am selling a MC server, DM me if you are interested

wraith rapids
#

not the right channel

quaint mantle
wraith rapids
#

show what the config looks like afterwards

quaint mantle
wraith rapids
#

and what path did you set to null

quaint mantle
#
if (e.getClickedInventory().getItem(1).equals(Discord)) {
            e.getWhoClicked().sendMessage(Links.getInstance().getConfig().getString("discord-message"));
        }

in the getItem() method what is that value? the slot the item is in?

#

e.getSlot()

wraith rapids
#

you aren't setting it to null

quaint mantle
#

?

wraith rapids
#

you are setting everything under it to null

#

you are setting spawn.x to null; set spawn to null

quaint mantle
#

OH

#

i understand

#

thank you

wraith rapids
#

setting everything in a section null results in an empty section

#

setting the section to null results in it being removed altogether

quaint mantle
#

thank you ๐Ÿ˜„

quaint mantle
wraith rapids
#

see the documentation

#

the documentation says what it means

quaint mantle
#

where?

#

ok how can i find?

dusty herald
#

?jd

quaint mantle
#

thx

wraith rapids
#

google is your friend

quaint mantle
#
Inventory inv = Bukkit.getServer().createInventory(null, 10, "ยง9Links");
        if (e.getClickedInventory().getItem().equals(Discord)) {
            e.getWhoClicked().sendMessage(Links.getInstance().getConfig().getString("discord-message"));
            e.getWhoClicked().closeInventory();
        }

i have a custom item called "Discord" and i have it in the inv variable. I'm trying to get it so if the Discord item is clicked inside the inv, it will send a message and close the inv

wraith rapids
#

get the slot that was clicked from the event

#

use that slot number to get the item that was clicked from the inventory

hollow river
#

hey so i'm a little conflicted on what to do here. i want to create custom quests but can't decide on using some file containing quest data, or to make a separate class for each quest (so that way i can heavily customize it and make quests more unique, trigger some animation, do something to the player etc. which i wouldn't be able to do with just loading in a quest form a config file) so would creating a separate class for each quest be the best option here?

#

this would eventually also translate to custom npc's who do different things on interaction/death, custom mobs, custom items etc.

#

i just don't know if ending up with 60+~ quest class files would be good practice

earnest junco
# hollow river hey so i'm a little conflicted on what to do here. i want to create custom quest...

Hard coding is easier short term, but allowing configuration through files is going to please whoever you do that for much more and will cost you less work later on.
You could allow different actions like BREAK, KILL, etc. and load the quests through that.
IMO, configurable is always better. You could still hard code the extremely complex quests and abstract generic quests down to aforementioned actions.

deft sedge
#

?paste

queen dragonBOT
hollow river
# earnest junco Hard coding is easier short term, but allowing configuration through files is go...

yeah my approach with quest classes would be to make the process of making a new quest as easy as possible through code, most methods being in the main Quest class already so you can use already existing functionality like killing 5 types of a mob. i think i'll try and give classes for each quest a shot because i love the freedom in that approach. im also making the plugin just for myself as a learning opportunity to slowly make a big rpg plugin (kinda like wynncraft in the end) thanks for the advice!

stoic iris
#

How would I call an event if someone gets an advancement, and how check if a specific advancement is gained? I can't find the enum in the JavaDoc, if it even is in it.

candid galleon
#

well an event already exists for that @stoic iris

#

you wouldn't have to call it, it's already called

stoic iris
#

so how would I figure out what specific advancement was achieved in an event handler?

candid galleon
#

well

#

click on the javadoc link I sent

#

and find out

summer scroll
#

is sending titles thread-safe? means that i can run it in an async task

candid galleon
#

try it and see

stoic iris
#

if(event.getAdvancement() == x) what do I put for x?

drowsy helm
#

probably an enum

stoic iris
#

yeah I can't find where the list of enums are

candid galleon
#

it looks like Advancement extends Keyed, so you can get the name of the advancement with Advancement#getKey().getKey()

sleek dragon
#

struggling a little bit with some logic im trying to get figured out. im essentially trying to create an additional bar similar to the food bar in vanilla minecraft using custom icons via a resourcepack put into the player's actionbar with some negative space trickery to place it in the right spot.

showing it to the player I got down but the problem I am having is a way to take a percentage of how full the bar should be and create the string full of the icons (full, half full, and empty) in order to create the full bar. I got pretty far but 1. I feel I am severely over complicating it and 2. its not working as intended. it is always showing at least 1 half-full icon even when it doesnt need to (ex. half of the bar being full and the other half being empty bars)

heres my code so far:

#

so the //create bar part is where the issue lies

#

im essentially running a loop that runs 10 times (one for each bar) and checking whether that bar should be full, half full, or empty depending on the percent fullness of the entire bar

#

once I get to the part of the bar that is half full or entirely empty, I set the rest of the slots to empty icons and end the loop

#

the thing is I dont think it is reaching a point where it detects the slot is entirely empty for some reason

#

something must be wrong with my math

craggy dawn
#

ok, I just need a bit of help, I need to copy a world, but whenever I copy it, it just creates a super flat world. here is my code

WorldCreator wc = new WorldCreator("" + id);
World copy = Bukkit.getWorld("island-template");
wc.copy(copy);
w = wc.createWorld();
#

anyone know how I can fix this?

#

OHHHHH I just relized, WorldCreator.copy() only copies the settings, not the world, how can I accomplish this?

#

is the event triggering?

#

are you getting an error?

#

also wait.. are you casting event to player?

#

oh ok

#

yeah ok

young knoll
#

Still an unsafe cast

craggy dawn
#

not weird, u were casting event to player, that would never would

craggy dawn
young knoll
#

Also should probably use <= 0

craggy dawn
#

do if(e.getEntity() istanceof Player)

#

k good

dense goblet
#

whyyy is custom RecipeChoice not supported .-.

young knoll
#

What

dense goblet
#

if you make a class which implements RecipeChoice, it can't actually be used when registering recipes

young knoll
#

Why are you making a class that implements recipeChoice

dense goblet
#

because I have custom items that can be smelted

dense goblet
#

that will not work

young knoll
#

Why not

dense goblet
#

because my custom items are not simple and their recipes may not be either

young knoll
#

Doesn't matter?

dense goblet
#

yes

young knoll
#

It matches any custom item

dense goblet
#

it would not work for a scenario like:
an iron ingot with PDC tag "type" = "ingotSilver" and tag "quality" >= 0.8

young knoll
#

Well the type part would work

dense goblet
#

yes but that is the easy type

young knoll
#

You aren't supposed to implement bukkit interfaces, but it should work in theory

dense goblet
#

I already have custom crafting system, just gotta hook into the furnace

#

it unfortunately doesnt work

#

gives an error

#

and is labelled as illegal to implement in the docs

#

it doesnt make anything impossible but I gotta do workarounds to check if the furnace recipe is doing a vanilla recipe or one of my custom ones

#

because also you can't get the recipe's NamespacedKey from FurnaceSmeltEvent

young knoll
dense goblet
#

okay I see why its unsupported

#

if either that or the key thing worked it would be okay but unfortunately neither do so workarounds it is

topaz cape
#

hey! i just switched to maven and while building the plugin i get this error [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project GPractice: Compilation failure: Compilation failure: [ERROR] Source option 5 is no longer supported. Use 7 or later. [ERROR] Target option 5 is no longer supported. Use 7 or later.

#

do anyone know how to fix that by any chance?

young knoll
#

Set your compilation target to java 8

#

Or higher

topaz cape
#

same error

summer scroll
#

show pom

topaz cape
#
  <modelVersion>4.0.0</modelVersion>
  <groupId>me.iiAhmedYT.Practice</groupId>
  <artifactId>GPractice</artifactId>
  <version>1.0</version>
  <name>GPractice</name>
  <repositories>
    <repository>
        <id>spigot-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
</repositories>
    <dependencies>
    <dependency>
           <groupId>org.spigotmc</groupId>
           <artifactId>spigot-api</artifactId>
           <version>1.8.8-R0.1-SNAPSHOT</version>
           <scope>provided</scope>
    </dependency>
        <dependency>
            <groupId>org.javacord</groupId>
            <artifactId>javacord</artifactId>
            <version>3.3.0</version>
            <type>pom</type>
        </dependency>
    </dependencies>
    
</project>
#

i really still didnt figure out how im going to include plugin.yml too but im looking into it

summer scroll
#

add this

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
topaz cape
#

it says ```Description Resource Path Location Type
'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. pom.xml /GPractice line 9 Language Servers

#

is that normal?

summer scroll
#

oh

#

add version, sec.

#
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
topaz cape
#

oh 1s

#

uh thank you

summer scroll
#

no problem

quaint mantle
#

any1 wanna come help me test my plugin ?

#

i need another player to test it with

#

its a one in the chamber plugin

candid galleon
#

@quaint mantle ip and version?

topaz cape
blazing scarab
#

do we support outdated versions?

topaz cape
#

its like a pom.xml issue

#

after i added the maven shad plugin this started to happen

quaint mantle
topaz cape
#

its not the version problem...

#

bruh

#
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>```
#

its this thing

blazing scarab
#

Anyways stop supporting evil

sullen marlin
#

you need to remove the signature.ds from your shaded depends

#
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.3</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>**/*.java</exclude>
                                <exclude>**/*.SF</exclude>
                                <exclude>**/*.DSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
            </plugin>```
topaz cape
#

oh thanks md_5!

torn oyster
#

would hard drive speed affect server preformance

torn oyster
#

by how much

quaint mantle
#

idk

#

if your drive is slower then worlds load slower

#

plugins that use custom configs would be slower

torn oyster
#

i have to transfer my server to another hard drive

#

cuz my ssd ran out of space

#

0 bytes left

young knoll
#

Configs are stored in memory

torn oyster
#

i was pregenerating a world

young knoll
#

So they probably wonโ€™t be impacted much

torn oyster
#

yeah i was pregenerating a world and it kinda ran out of space

#

0 bytes left

quaint mantle
#

not specific ones

digital plinth
#

is there an entity move event?

#

can i cancel out the movement of a zombie

#

without messing with packets?

torn oyster
#

does anyone have a good hard drive that is under $100

digital plinth
#

i do

#

umm

#

i think its 4gb

torn oyster
#

link

digital plinth
#

for like 60 bucks

torn oyster
#

4 gigs

#

wtf

digital plinth
#

okay lemme try to find it

digital plinth
#

XD

torn oyster
#

my server is like 200 gigs

#

lol

digital plinth
#

............

#

XD

digital plinth
#

not 4GB

#

TB

torn oyster
#

oh lol

digital plinth
#

heres the link

#
young knoll
#

You could also give them no AI, or high slowness

digital plinth
young knoll
#

Or set their movement speed attribute to 0

digital plinth
#

oh how can i do that?

#

zombie.setspeed?

#

4gb for 50 bucks @torn oyster

young knoll
#

getAttribute

digital plinth
#

thx

vast quest
#

if (player.getWorld() != "world") {

#

how can I do this

#

says Operator '!=' cannot be applied to 'org.bukkit.@org.jetbrains.annotations.NotNull World', 'java.lang.String'

digital plinth
#

liek this?

young knoll
digital plinth
#

what does player.getworld return ?

#

a string or a world i forgot

digital plinth
vast quest
#

how can I make it get as a world

#

issa world

young knoll
vast quest
#

so this will do th ejob?

#

if (!player.getWorld().getName().equals("world")) {

young knoll
#

Mhm

eternal oxide
#

Thats Paper not Spigot

halcyon bridge
#

Umm okay

vast quest
#

how can I make my plugin use java 11?

quiet ice
#

Gradle, Maven or JDT/Whatever IntelliJ's Build system is called?

vast quest
#

Maven

quiet ice
#

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>11</source> 
                    <target>11</target>
                </configuration>
            </plugin>
#

There is another way, but I don't know it since I usually always move over to the compiler plugin

vast quest
#

tehre is this?

#

<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

#

oh ye

#

I think changing that to 11 will work

#

since htis uses that

#

<source>${java.version}</source>
<target>${java.version}</target>

quiet ice
#

why do that

vast quest
#

idk its just the default pom

quiet ice
#

The other way is

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
  </properties>
vast quest
#

Ok

#

do I just

#

copy paste that

quiet ice
#

Not really given that you appear to already explicitly use the compiler plugin

vast quest
#

mk

#

also is there any reason to use java 11

#

like is it better?

quiet ice
#

YES!

vast quest
#

how much better

vast quest
#

should I update my plugins to java 11?

#

?

quiet ice
#

I recommend to, especially when dealing with (N-)IO

vast quest
#

Ok

#

I was wondering if its actually better performance wise

#

if I just update it

quiet ice
#

You get a better compiler, I heard they improved on string concentration quite a lot

vast quest
#

Oh

#

cool

quiet ice
#

It will lead to better performance if you compile it natively at newer versions, even if it will be minimal

vast quest
#

Performance is performance ok

eternal oxide
#

It all depends on who uses your plugin

cold field
#

I was wondering how bungeecord works, are there any services that have more functions?

eternal oxide
#

You don;t really know what Bungee does, yet you are already looking for something that does more?

ivory sleet
#

More functions, elaborate

cold field
#

I havent looked yet. But I know what it does

quaint mantle
#

Java 11 has useful annotations and Pairs ๐Ÿฅด

ivory sleet
#

Java 16 have sealed classes and records

cold field
cold field
eternal oxide
#

Thats its job, its a proxy.

ivory sleet
#

Define better?

#

You mean like super proxy or smtng?

cold field
#

idk, why some network prefer not to usee bungee

ivory sleet
#

What

eternal oxide
#

I use Eclipse, Conclue uses InteliJ

ivory sleet
#

Yes I mean some servers consist of just one server

#

Then using a proxy is quite pointless

#

Most networks use bungeecord or some fork of it assuming you want to have a proxy server for your backend servers

molten hearth
ivory sleet
#

But like hypixel uses redis

#

Or well both precisely

eternal oxide
molten hearth
#

I'd still choose waterfall if they only had typo fixes

ivory sleet
#

Your choice

cold field
#

I need to know how that works... Can you guys link me some website?

eternal oxide
#

How what works?

cold field
#

A proxy

eternal oxide
ivory sleet
#

Just google it

#

Whatโ€™s a proxy server

eternal oxide
#

and DON'T stop reading after its up and running.

cold field
#

soo. bunge is the same thing as a proxy?

eternal oxide
#

If you fail to read the Post-Installation section you will be exposed to every hacker in the universe.

cold field
#

ok, i'm going to read

quiet ice
#

if that is the case, why isn't that the default?

eternal oxide
#

because its about configuring the servers

#

So not in the Bungee settings

quiet ice
#

makes sense

cold field
#

Guys, i read something but I've questions.. For instance, if the proxy does an intermediary job how can the final server knows the user ip?

#

And, if I host something and all the user traffic goes through the proxy server and that server is a low performance server this will cause lag, right?

drowsy helm
#
  1. the proxy forwards the ip to the server
#
  1. yes, it will act as a bottleneck
cold field
#

hum ok.

#

Is it better have one powerful proxy or have many?

drowsy helm
#

I don't think bungee allows multiple proxies

#

wait no i lied it does

#

i would say one powerful proxy

#

not necessary to have multiple until you reach the tens of thousands of players

cold field
#

nutil?

drowsy helm
#

until

#

its one letter off man

#

lmao

cold field
#

ohhh

#

ok

#

๐Ÿคฃ

drowsy helm
#

all the proxy does it forward packets, it doesn't require a super beefy server anyway

cold field
#

what can it be the security issues? That a user can access directly the server without using the proxy?

drowsy helm
#

well a proxy is more safe

#

you only have to expose the proxy's port

#

rather than exposing all the servers' ports

cold field
#

no what I mean is, what are the security issues if I use a proxy

drowsy helm
#

theres none really

cold field
#

oh

drowsy helm
#

only if that proxy server gets ddosed

#

thats your whole network down

cold field
#

mh..

drowsy helm
#

but theres not much you can do anyway, would happen with a regular server

cold field
drowsy helm
#

depends on which host

#

but yeah

#

most do

cold field
#

With multiple proxies I can mitigate that, right?

drowsy helm
#

to a degree yes

#

but still it's not super necessary

#

even networks with 10k concurrent players use 1 proxy

#

they are super robust

cold field
#

so they have a powerful ddos protection

drowsy helm
#

yeah

#

most dedi hosts like OVH, SYS, hertzinger etc have ddos protection

#

cloudflare, if you use a domain

cold field
#

Mh, I need to make a school project about that. What should I use? One proxy or many?

drowsy helm
#

one

#

many proxies = more management

cold field
#

I don't really need to take care of it. I just need to design an architecture

drowsy helm
#

many proxies also mean your client is going to have to connect from one of many ports

#

unless you have a loadbalancer

#

which is another type of proxy

#

not minecraft related

cold field
#

I think hypixel make uses of a "loadbalancer", right?

drowsy helm
#

yeah they do

#

they probably have like 10 proxies, and a load balancer

cold field
#

mh, interesting.

#

This is my final exam of secondary school. I need to make something good

drowsy helm
#

whats the exam exactly

cold field
#

It is of my choice

#

I'm creating a minecraft server

#

XD

#

All my classmates have done websites, but I wanted to do something else

#

so I'm here

#

ahahah

drowsy helm
#

fair call

cold field
#

I don't really need to setup a system like the hypixel one. I need only to design it. Do you think that it would more appreciated a system like the hypixel one or a single proxy?

proper notch
#

hypixel will 100% have way more than 10 proxies btw

#

also for using MC through cloudflare, you'd have to pay for spectrum.

cold field
#

spectrum?

quiet ice
#

premium cf

proper notch
#

Mhm. Their services for websites are free, but for other services it's paid

cold field
#

ooh

proper notch
#

Unless ur a big server, ovh ddos prot is enough.

#

I can't remember what Hetzner's ddos prot is like but off the top of my head, it's not great

proper notch
#

Having more proxies is always gonna be better if you have say more than 500 people. It gives you redundancy, better performance and also means you hopefully designed your system out of the box to be scalable.

#

And if you can horizontally scale, that's a huge benefit over vertically scaling.

#

And in this modern day, having the skills to develop horizontally scaled systems is important to so many things.

proper notch
#

Horizontal scaling = being able to add more systems

#

Vertical scaling = just making the existing system more powerful

cold field
#

oh

#

ok

#

any suggestion to gets started with that. I need to know what a load balancer is and after that what?

proper notch
#

E.g google won't just have 1 big really powerful computer. They've designed their systems to use tens of thousands or hundreds of thousands of systems that can all coordinate with each other.

cold field
#

Mhmh

proper notch
#

same as hypixel I assume. They'll have their proxies spread over many servers

#

Your loadbalancer will likely depend on what other softwares you use. I've only done it within kubernetes, so I have no idea about loadbalancers that are good outside of that

#

Just know when you're doing stuff with multiple proxies, loadbalancers, etc.. you're going to be using a lot of APIs to make everything communicate, so the structure of it can be quite big. If it's too much, just abandon one part of it.

cold field
proper notch
#

Nah just like, abandon a part of the structure. If it's too complex, maybe use a less advanced loadbalancing system that doesn't account for player counts. Or maybe don't bother having the multi-proxy system.

cold field
#

Oh k

proper notch
#

stuff like this when doing it for the first time will take a while to find good structures, good loadbalancers, etc..

coarse crown
#

Hi, I want to ask a question about RAM usage on minecraft server, I have 75 Active player and around 60+ Plugins, and I want to use 12gigs of ram for the server, do you think it will be enough? (my Server is a Survival SMP Server, so there's a chunk load, etc)

sullen marlin
#

More than enough

#

Minecraft is rarely ram limited

coarse crown
#

I've read something about "Minecraft Custom Startup" with Aikar Flags, do you think it helps for a minecraft server like mine?

young knoll
#

Probably

quiet ice
#

unless you are doing some strange things, correct startup flags always help

#

Sadly the flags are often used as an example to why java is bad, which note it is not

cold field
proper notch
#

np. It's a long road ahead

cold field
#

I hope so

#

I will glad to follow it

quaint mantle
#

How can I change mob's facing?

#

example: mob is looking north. i want change it to south

wraith rapids
#

rotate it

eternal oxide
#

setDirection(BlockFace.SOUTH.getDirection()) on the location

quaint mantle
#

Thanks, but setDirection in Entity not exists

eternal oxide
#

on Location

wraith rapids
#

you'll probably have to get the location, set the location's direction, and then set the location

quaint mantle
#

ah ty

cold field
#

Should I use world edit or fawe? I know that fawe make use of async thread but some people told me that in the past fawe has caused world currption.

#

Or any other plugin

sleek pond
#

fawe is an addon

#

you steel need we

young knoll
#

Not anymore

#

FAWE was pretty good back in 1.12

#

Not sure how it is now

#

If you arenโ€™t changing massive amounts of blocks regular worldedit is probably fine

cold field
#

k

#

thanks

wraith rapids
#

fawe is short for fast async world exception

quiet ice
#

you stole that from paper

#

now pay your taxes

sleek pond
#

lol

wraith rapids
#

i'm a citizen of paper

#

access to their memes is my birthright

#

supposedly fawe isn't as batshit unstable now as it was at some point, but the only guy i've seen defending it in recent memory is its author, so I'd take it with a grain of salt

quaint mantle
#

Hey spigot! I'm setting mob's facing. here's my code:

entity.getLocation().setDirection(new Vector(?, ?, ?));

Where should yaw or pitch go in '?'.

wraith rapids
#

read the documentation

#

i'm pretty sure there's a method somewhere that shits out a vector from a given yaw and pitch

quaint mantle
#

ya, i already read the doc. hmm

wraith rapids
#

do you absolutely need pitch and yaw?

quaint mantle
#

yass

#

I don't know where to put it in the vector.

sleek pond
#

?

quaint mantle
#

x or y or z?

#

new Vector();

wraith rapids
#

you don't put it in the vector

quaint mantle
#

hmm?

sleek pond
#

what are you talking about

wraith rapids
#

a vector represents a direction with 3 values

sleek pond
#

please make coherent sentences

wraith rapids
#

distance towards X

#

distance towards Y

#

distance towards Z

#

directly up would be 0,1,0

#

directly south would be 0,0,-1

#

or would that be 0,0,1

#

i don't fucking remember

sleek pond
#

positive is usually up, right and forward

quaint mantle
sleek pond
#

jesus fuck

wraith rapids
#

you instantiate the vector

sleek pond
#

new Vector(distance towards X, 0, 0);

wraith rapids
#

with the fucking constructor

quaint mantle
#

yap

wraith rapids
#

if there's no method to actually shit out a corresponding vector for you, you could always rotate an unit vector around the corresponding axes with the pitch and yaw you need

#

but you probably don't actually need pitch and yaw

quaint mantle
#

i understood ty

quaint mantle
#

south's yaw is 0

#

and pitch is 0

wraith rapids
#

because it's not pitch and yaw

#

it's a distance

quaint mantle
#

What distance

wraith rapids
#

of the direction

sleek pond
#

ok

#

ready

#

think of it like this

wraith rapids
#

0,0,1 -> 1 block to the south

sleek pond
#

do you know the coordinate plane?

sleek pond
wraith rapids
#

0,1,1 -> 1 block to the south, 1 block up

quaint mantle
sleek pond
#

think of it like this

#

your entityies head is at 0, 0, 0

#

X, Y, Z

quaint mantle
#

yaw, pitch, and what

wraith rapids
#

lmao

sleek pond
#

jesus fuck

#

at X, Y and Z

quaint mantle
#

ah

sleek pond
#

coordinates

quaint mantle
#

but it's direction

sleek pond
#

forget about yaw and pitch for now

#

and directions

sleek pond
#

the vector can be any point in space

#

thats basically what it is

quaint mantle
#

I don't understand because this is a 3D direction, not a coordinate.

#

okay

sleek pond
#

when you say lookInDirection(Vector)

#

its as if the head is looking at that point

wraith rapids
#

it's a 3D direction, yes; that is why there are 3 components

#

1 component for each dimension

#

X,Y and Z

quiet ice
#

Vectors are location, direction & force

sleek pond
#

or color

#

if your in opengl

wraith rapids
#

or your mom

quiet ice
#

Color?

sleek pond
#

rgb

#

sometimes u get a vec4 with an a value as well

quaint mantle
#

ahhhh wait

#

I think i understood

sleek pond
#

a vector is basically an array of 3 numbers

#

how you use it is up to you

wraith rapids
#

well

quaint mantle
#

wait i'll draw a picture

wraith rapids
#

that it has 3 numbers is an arbitrary distinction

sleek pond
#

usually it is an arrow ferom 0, 0, 0 connecting your point

quiet ice
#

A Java.utils.Vector vector is a list that is synchronized (i. e. thread safe but not really)

wraith rapids
#

the vector list is ancient trash

sleek pond
#

it's a good way to understand

#

thinking of a vector as just one thing is very limiting

wraith rapids
#

has anyone brought in the actual definition yet

#

direction and magnitude and that shit

quiet ice
#

Yeah, the vector list should be deprecated; I know someone that is overusing it

sleek pond
#

do u think this guy will understand the actual definition?

#

lol

quiet ice
quaint mantle
#

is it right?

sleek pond
#

yes

wraith rapids
#

well it has the word direction in it so

quiet ice
sleek pond
#

sorta

#

you?

wraith rapids
#

imagine that the entity's head is at the center of the world

#

at X Y Z coordinates of 0 0 0

quaint mantle
#

Ahh

wraith rapids
#

now, imagine that the entity is looking at a block

#

if this block is at X Y Z 0, 1, 0

young knoll
#

I mean you can set the pitch and yaw directly too, if you wanted to

wraith rapids
#

it will be looking directly upwards

wraith rapids
#

because the block is one block above it, directly above it

sleek pond
#

not vector

wraith rapids
#

if the block is at 0,0,1, the entity will be looking directly south

quaint mantle
#

Ahh

wraith rapids
#

because the block is 1 block to the south from the entity's head

young knoll
#

Make a location, set pitch and yaw, tp to location

quaint mantle
#

yaa

sleek pond
#

hes trying to make an entity look somewhere

wraith rapids
#

if the block is at 0,1,1, the entity will be looking directly south and 45 degrees up

#

because the block is 1 block to the south and 1 block up

wraith rapids
#

this would represent a yaw of 0 and pitch of 45, if I remember my numbers correctly

sleek pond
#

oh wait

#

wtf

#

you can just do .getLocation().setYaw

wraith rapids
#

myeah

sleek pond
#

and .setPitch

quaint mantle
#

oh

#

lol

young knoll
#

You canโ€™t just use getLocation

#

As it returns a clone

quaint mantle
#

ah

wraith rapids
#

you'll have to set it back afterwards

#

like I said at the very beginning of this conversation

sleek pond
#

setLocation(getLocation().setYaw(yaw).setPitch(pitch))

#

kinda messy but whatever

young knoll
#

Pretty sure those are void methods

wraith rapids
#

that'd be quite annoying

sleek pond
#

idk

#

if they are

wraith rapids
#

so that's probably the case

sleek pond
#

then just stack them below one another

#

but store the location

wraith rapids
#

although I do remember Locations being super fucking arbitrary when it comes to returning itself or a clone

young knoll
#

They are

sleek pond
#

in what world would you want a clone

wraith rapids
#

every fucking time I work with them I have to go look at the source to check whether I need to defensive clone or not

#

some of the methods return a clone

#

others don't

#

and it's not fucking documented

thorny bridge
#

I have this so far m.addEnchant(Enchantment.DAMAGE_ALL, 20); what else am i missing from it?

#

i have defined the meta in previous code

quaint mantle
#

okay, thanks you all ๐Ÿ™‚ so,
I want to randomly choose yaw from -180 to 180 on hand. Can we do it like this?

entity.getLocation().setYaw(new Random().nextInt(180 + 180) - 180);
young knoll
#

Did you set the meta back

thorny bridge
#

no, is there another argument that the code needs?

young knoll
#

You may need to add true at the end

#

Donโ€™t remember what the default is

wraith rapids
#

it might blow up because of the unsafe enchantment

young knoll
#

Yeah, thatโ€™s what the Boolean does

wraith rapids
#

isn't there like a method somewhere with an extra bool that you need to use for overleveled enchants

thorny bridge
tall brook
#

I'm looking for the translation plugin for my Minecraft server

wraith rapids
#

cool

tall brook
#

?

sleek pond
#

don't mind him

#

hes wierd

tall brook
#

Ok

wraith rapids
#

not the right channel for looking for plugins

#

this is the channel for writing plugins

tall brook
#

I'm looking for a volunteer plugin writer.

wraith rapids
#

yeah, not the right channel

#

go on some marketplace or something

#

this channel is for cool kids only

cold field
woeful crescent
#

Is it ok to call PlayerMoveEvent, or should I just make a BukkitRunnable every tick?

wraith rapids
#

you probably mean listen to move event rather than call it

#

depends

#

the player can move multiple times a tick

#

so if you need super high precision, use the event

woeful crescent
#

But otherwise, use the runnable?

#

I'm trying to measure unique blocks travelled

wraith rapids
#

if the code is lightweight, the listener is fine

woeful crescent
#

It's adding a Location to an ArrayList in a HashMap if the block there isn't air, and if the list doesn't contain the Location.

wraith rapids
#

sounds like a kind of poor implementation for what you're doing, but it's lightweight

#

well, cpu wise, anyway

cold field
#

why world edit doesn't maintain state of the blocks????

wraith rapids
#

are you on the right version

wraith rapids
#

it'll yeet the actual block data if there's a version mismatch

woeful crescent
#

What would be a better implementation?

wraith rapids
#

something that doesn't involve storing potentially tens of thousands or millions of block locations in contiguous arrays in memory forever

woeful crescent
#

Nah, I don't mean that

#

it resets on death

#

it's a thing that encourages players in an ffa pvp game to move around more

#

a class upgrade called Traveller

wraith rapids
#

mmmmaybe then but there are still some issues

#

for example, you probably don't want to add more travelled distance if the player is standing still

#

which would mean making sure the block has changed since

#

you probably also don't want to accumulate distance if the player moves between the same 2 blocks repeatedly

#

that is, each block should probably only count once, or maybe once per some timespan

#

this would be better represented by a Set than a List

cold field
#

@wraith rapids Do you know why when a player join into the server and I send a playerInfo packet and a playerSpawnPacket to him right when he has joined or within 20ticks the skin of the fake player isn't shown?

wraith rapids
#

dunno, i don't do skins

#

if the skinsrestorer discord has a dev channel you could ask there

cold field
#

thanks for the tip

woeful crescent
#

to check if the player has already been there

wraith rapids
#

yes, well, see, the contains check of a List isn't very fast

#

if you have 1000 locations in the list, you'll have to go through every last one of them with every .contains check

#

in comparison, a Set ideally only does one or two comparisons regardless of its size

#

you speak of a "unique blocks travelled" metric

#

therefore the data set that you use should emphasize on that "unique" aspect

cold field
#

multiverse-core should really implement tab-completation...

wraith rapids
#

Lists can contain the same element multiple times

#

the elements of a list aren't necessarily unique

#

the elements of a Set, however, are unique in that set

#

an element either is in the set, or it is not in the set

#

this represents what you are doing much better

woeful crescent
#

Yeah, I was gonna change it to a set

wraith rapids
#

to further minmax things you could create an immutable blocklocation class that caches its hashcode for better hashset performance and smaller memory footprint

#

but that could be deemed premature optimization

woeful crescent
#

Also, should I be using a HashMap<UUID, Set<Location>> to store it uniquely for each player or is there a better option?

wraith rapids
#

which is apparently a massive fucking sin

#

nested collections and maps are sort of a code smell, generally it'd be prefered to have a Map<UUID, PlayerData> map, and have the PlayerData class hold onto the Set<Location> and whatever other data you might store for your players

thorny bridge
#

how do i allow unsafe enchantments from item meta

wraith rapids
#

we told you when we last talked about it

thorny bridge
#

what is the code

#

i forgot

wraith rapids
#

read what we said

thorny bridge
#

ok

quaint mantle
#

Hello, spigot! i want make mob to it doesn't get pushed back. livingEntity.setCollidable(false); not working

#

how to do that?

#

thanks u ๐Ÿ™‚

wraith rapids
#

collisions are two-way

#

for 2 entities to not collide, both of them have to have collisions set to false

quaint mantle
#

okay, but if player push back entity?

#

I meant, player vs entity

woeful crescent
#

Will adding a duplicate to a HashSet throw an exception, or just not add it?

#

Nvm

cold field
#

@wraith rapids can't find the right version in which the schem was saved... If I use MCEDIT is the state mantained?

woeful crescent
#

Any better way to do this? (checks set size for player attribute modifier, resets on death)

public static final HashMap<UUID, Set<Block>> travelled = new HashMap<>();

    @EventHandler
    public void blockGet(PlayerMoveEvent e){
        UUID pUUID = e.getPlayer().getUniqueId();
        try{
            Set<Block> locSet = travelled.get(pUUID);
            Block block = e.getTo().getBlock();
            locSet.add(block);
        }catch(NullPointerException addToMap){
            travelled.put(pUUID, new HashSet<>());
        }
}```
wraith rapids
#

don't catch nullpointerexception

woeful crescent
#

What should I do instead?

wraith rapids
#

make sure you don't cause a nullpointerexception to be thrown

woeful crescent
#

does catching exceptions slow it down?

wraith rapids
#

yes

wraith rapids
#

significantly

#

and it is bad practice to catch instead of check

#

you should stop it from exploding before it explodes

#

Map also defines a method that computes a value for the key if it isn't present yet

thorny bridge
#
        ItemStack sharpXX = new ItemStack(Material.DIAMOND_SWORD, 1);
        ShapelessRecipe sharpXXr = new ShapelessRecipe(sharpXX);
        sharpXXr.addIngredient(9, Material.DIAMOND_SWORD);
        ItemMeta m = sharpXX.getItemMeta();
        m.setDisplayName("Sharpness XX(20) Book");
        m.setLore(Arrays.asList(ChatColor.GREEN + "Gives you sharpness 20"));
        sharpXX.setItemMeta(m);
        sharpXX.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 20);
        Bukkit.addRecipe(sharpXXr);``` what am i doing wrong
wraith rapids
#

travelled
.computeIfAbsent(uuid, (k) -> new HashSet<>())
.add(block);

sharp bough
#

sharpXX.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 20,true);

#

or

#

sharpXX.addEnchantment(Enchantment.DAMAGE_ALL, 20,true);

#

@thorny bridge

thorny bridge
#

ok thanks

woeful crescent
wraith rapids
#

it's extra boilerplate to achieve the same result

#

that is basically what computeIfAbsent does

woeful crescent
#

ok

#

Also, I am now using a Set<Block>. Any better way to do this?

wraith rapids
#

depends on your definition of better

woeful crescent
#

faster, more lightweight

#

since I'm doing this every time a player moves

wraith rapids
#

to further minmax things you could create an immutable blocklocation class that caches its hashcode for better hashset performance and smaller memory footprint

quaint mantle
#

hello, spigot i'm changing mobs' facing

#

entity.getLocation().setDirection(BlockFace.NORTH.getDirection()); Doesn't work on entitymagmacube

wraith rapids
#

are you setting the location back onto the entity like we told you to

lost depot
#

hey, wildcard permissions need to be coded by the plugin itself, right?

wraith rapids
#

depends on your definition of plugin and wildcard permissions

#

are you writing a permission plugin?

lost depot
#

non-permission plugin

wraith rapids
#

the permission plugin handles wildcard permissions if it supports them

#

that is, your plugin can check for myplugin.x

lost depot
#

i expect the server owner to use something like luckperms etc.

wraith rapids
#

and if a player has myplugin.*

#

then the permission plugin, if it supports wildcard permissions, will return true for the myplugin.x query

wraith rapids
#

if that's what you mean by wildcard permissions, no, you don't need to handle them yourself

#

they're handled by the perms plugin

lost depot
#

but if they're not, they wont work, right?

wraith rapids
#

myes

lost depot
#

k, thx

wraith rapids
#

if you want to support people who don't use wildcard compatible perms plugins, define a root permission in your plugin.yml

#

and set all of the other permissions as children of that node

lost depot
#

oh that makes sense

wraith rapids
#

then, giving that root node, like myplugin.all will give the player all of its children, giving them access to all of the things

#

it's usually also nice if you provide group nodes like myplugin.admin and myplugin.player to group together different permissions that are probably used by different groups of users, like admins and regular users

#

that way the end user only has to give those nodes instead of going through a list of 3000 permission nodes and adding them individually

sharp bough
thorny bridge
#

i didnt add any meta

#

this is the code //Sharp XX Sword ItemStack sharpXX = new ItemStack(Material.DIAMOND_SWORD, 1); ShapelessRecipe sharpXXr = new ShapelessRecipe(sharpXX); sharpXXr.addIngredient(9, Material.DIAMOND_SWORD); sharpXX.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 20); Bukkit.addRecipe(sharpXXr);

sharp bough
#

you gotta add the enchantment to the item meta

thorny bridge
#

how should i do that?

#

ok,

#

here is what i have now

#
        ItemStack sharpXX = new ItemStack(Material.DIAMOND_SWORD, 1);
        ShapelessRecipe sharpXXr = new ShapelessRecipe(sharpXX);
        sharpXXr.addIngredient(9, Material.DIAMOND_SWORD);
        ItemMeta meta = sharpXX.getItemMeta();
        meta.setDisplayName(ChatColor.BLUE + "Sharpness XX");
        meta.addEnchant(Enchantment.DAMAGE_ALL, 20, true);
        sharpXX.setItemMeta(meta);
        Bukkit.addRecipe(sharpXXr);
sharp bough
#

yea

#

that doesnt work?

thorny bridge
#

nope

#

doesnt add the enchant

#

the crafting recipe works but doesnt craft it with an enchnatment

sharp bough
#

uh if you give me a sec i think i can find a custom craft i did once

thorny bridge
#

ok

sharp bough
#

i lost it lol

#

do you get any errors?

thorny bridge
#

nope none

sharp bough
#

but the ddisplay name works?

thorny bridge
#

no

#

none of the meta transfers

sharp bough
#

but the craft does

thorny bridge
#

yes

sharp bough
#

did you try to debug it?

#

using testNUM on every line

#

seeing if it stops working for some reason

#

and sout the result of every action

thorny bridge
#

wdym by testNUM?

wraith rapids
#

what am I even looking at

sharp bough
#

yea like test1 test2 test3

wraith rapids
#

construct the recipe after setting the meta

#

the constructor clones the result stack

thorny bridge
#

oh ok i will try that

wraith rapids
#

so changes made to it afterward don't take effect

cinder thistle
#

imagine being unverified

thorny bridge
#

yes

cinder thistle
#

except for nny he's an honorary verified

wraith rapids
#

lmao

cinder thistle
#

we like nny around here

wraith rapids
#

i'm a pretty liked guy

sharp bough
#

if you gotta say you are liked then you are not liked

#

lmao

cinder thistle
#

who wouldn't like what i assume is hitler santa

thorny bridge
# wraith rapids construct the recipe *after* setting the meta

now the code looks like this ItemMeta meta = sharpXX.getItemMeta(); meta.setDisplayName(ChatColor.BLUE + "Sharpness XX"); meta.addEnchant(Enchantment.DAMAGE_ALL, 20, true); sharpXX.setItemMeta(meta); ItemStack sharpXX = new ItemStack(Material.DIAMOND_SWORD, 1); ShapelessRecipe sharpXXr = new ShapelessRecipe(sharpXX); sharpXXr.addIngredient(9, Material.DIAMOND_SWORD); Bukkit.addRecipe(sharpXXr); is this right?

wraith rapids
#

it's right-er

thorny bridge
#

what did i do incorrect

wraith rapids
#

i don't know

thorny bridge
#

ok

wraith rapids
#

see if it works and we'll find out

thorny bridge
#

i will try

#

nope

#

it cant even build it

#

bc it cant find the sharpXX before the recipe

wraith rapids
#

then move the declaration up

#

learn java, basically

thorny bridge
#

ok

#

lol

#

YES

#

IT WORKS

#

THANKS!!!

ivory sleet
#

pog

sullen dome
thorny bridge
#

it did

#

i just couldnt upload a picture

sullen dome
#

why did you asked if it's right then? if it shows errors, it's in 99% of cases not right

thorny bridge
#

idk