#help-development

1 messages ยท Page 622 of 1

river oracle
#

ahhh okay

#

I thought maybe display always returned regardless or sometihng

worldly ingot
#

Also also, getTag() can return null if the item doesn't have any NBT

river oracle
#

okay

blazing flare
#

If I wanted to display a list of rewards for completing a quest, but some of the rewards are commands, what are my options for that?

zenith gate
blazing flare
#

for example, if the reward is to give the player a crate key, but that's a separate plugin that isn't anything to do with me, how would I do something like: rewards: 1x diamond, 1x epic key, ... as a message to the player?

hasty prawn
#

If it's configurable just add another key in the YML that is "display" and just display that

blazing flare
#

for the quest itself, or for the crate plugin, or what precisely?

summer scroll
#

Is it possible to modify entity's attack reach?

summer scroll
#

Like it can attack player with 3 block or 5 block distance.

#

oh

trail coral
#

attack range is an attribute i think if i remember correctly

#

either entity attribute or item attribute

#

idk if thats what youre looking for tho

summer scroll
#

So normally can attack if the mob is close to its enemy.

#

I want to make let's example the mob can attack even the distance is 10 blocks.

zenith gate
#

oh wait

#

im so wrong

#

thats a mod.

#

๐Ÿ˜…

summer scroll
#

That might be it but it's a mod yeah.

carmine mica
#

CompoundTag#getCompound doesn't return null.

zenith gate
summer scroll
zenith gate
#

I believe so yes, but also some of this other stuff im reading, is that ray cast doesnt check for blocks. so you'll have to do something about that.

#

Which i might actually use this rayTrace I have some ideas.

summer scroll
trail coral
#

or item attributes

zenith gate
#

There are no attributes for that.

zenith gate
#

Also got like different levels of Precision which is nice.

summer scroll
vital sandal
#

how can I get the amount of netherwart can drop?

#

tried this but doesn't seemed to be right

torpid idol
#

i have a small question

#

if its posible or if someone know

#

i want to make a dispose plugin that when you open it and put items in there when you leave it the items disapear

#

and i really need 1 thing

#

how can i set the text "dispose" in the midle of the inventory

#

package me.shadow.inventory;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.Inventory;

import java.util.ArrayList;

public class MenuCommands implements CommandExecutor {
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {

    Player p = (Player) commandSender;

    Inventory inventory = Bukkit.createInventory(p, 27, ChatColor.DARK_GREEN + "Dispose");

    p.openInventory(inventory);

    return true;
}

}

zenith gate
#

Add spaces before the word dispose?

grizzled oasis
placid moss
#

not a solution but you should check if seconds < 0 and if so return "infinite" at the beginning so you dont have tot do the check at the end or use Math.abs

grizzled oasis
#

something i missed lol

placid moss
#

with s being the number of seconds

grizzled oasis
#

s is absseconds

#

or seconds?

placid moss
#

in your code absseconds

grizzled oasis
#

ok

placid moss
#

it wont work with negative seconds

grizzled oasis
placid moss
#

ok

grizzled oasis
#

works thanks

#

hope you have a great day

grave kayak
placid moss
#

what is not working

#

any error message

#

or description of what happens

grave kayak
vapid verge
#

Anyone have any luck writing unit tests with mockito and mockbukkit? its been a nightmare for me. I've been trying to mock an event, and pass it to my listener. I haven't found any solid examples, so i've been trying various approaches. I'm just very confused at this point. If anyone else has got it working (or knows an example), I'm all ears.

smoky anchor
green prism
#

Is it a good practice to use a static instance of the JavaPlugin class instead of putting it in a constructor for each class?

MyPlugin plugin = MyPlugin.getInstance();
trail coral
green prism
green prism
#

Thank you ๐Ÿ™‚
MikeTheShadow, what do you think instead?

vocal cloud
#

Good practice? Sort of? Technically it's better to have it as a constructor arg.

#

It really depends because imo I'd rather be able to just use plugin.xyz in my code rather than mainclass.getPlugin().xyz or create a new local variable everytime

echo basalt
#

I do DI all the way

trail coral
#

whats dl

#

di

#

something injection

#

right?

echo basalt
#

?di

undone axleBOT
trail coral
#

ye dependency injection

vocal cloud
#

It's pretty self-explanatory but the second you're making a bunch of plugin.something calls you really don't want to have to make a new local variable each time you want the plugin. Plus, if you make sub methods you'd have to unironically inject it into those as well or face doing another main.getplugin() call.

green prism
vocal cloud
#

It's entirely a design choice. In fact, you'd actually use a minutely larger amount of memory injecting. That being said, from a design aspect it's easier to use, and it will greatly cleanup the code because you don't ever have to do
Plugin plugin = Main.getPlugin(); plugin.doX; plugin.doY

green prism
vocal cloud
quaint mantle
#

What packet do I need to cancel being sent for player's not to appear on tablist? (only header and footer shows)

vocal cloud
echo basalt
#

damn I forgot to reply

#

there's a tab info packet

#

One of the modes is REMOVE_PLAYER

native bramble
#

at first it was working

#

i change NOTHING and after some time it starts kick players

quaint mantle
# echo basalt

What if I just stop the server from ever sending the packet to add the player to tab?

#

like cancel whenever that packet gets sent

echo basalt
#

I don't think the players spawn if they're not added to tab

quaint mantle
#

so I would just send that remove packet whenever that add player packet is sent?

echo basalt
#

Apparently if you set the repair amount to 0

#

it trips up

#

Because it's trying to convert leftover exp

native bramble
#

so i need to check if repairAmount >0?

echo basalt
#

not really

#

You just need to set the repair amount instead of manually repairing the itme

native bramble
#

like damageable.setDamage(item.getType().getMaxDurability() - repairAmount);?

umbral ridge
#

I think damage is actually from 0 to max instead of the opposite

#

So setDamage(0) will repair it

silent steeple
#

any1 got minecraft plugin ideas

umbral ridge
shadow night
#

Last time I did packets I had the problem that I couldn't gert anything by getWhateverType() and I had to get the raw modifiers and use nms for modification

echo basalt
#

Look at the NMS packet in whatever server version you're working with

eternal oxide
green prism
#

ElgarL, I need your opinion

shadow night
#

Packets are painful, but when you get them working it's super cool

eternal oxide
#

You are in luck, I have lots of opinions

green prism
# eternal oxide You are in luck, I have lots of opinions

I'm making a plugin that I'm going to put on SpigotMc with different inventories and that also has a yml file for the language. Do you think it makes sense to make all items in each inventory and messages editable or just the messages?

#

I would have to create a whole other system to implement message editing as well. I currently only have one system that allows me to get strings, but if I had to do something like this for every lore and displayname, I would mess everything up.

eternal oxide
#

If its for others to use the more customisation would be more attractive. However rememember if you allow Materials ot be specified in the config you will have to trap errors in different versions (Materials missing)

#

keeping language to a separate file would be best

green prism
#

Thank you so much Elgar ๐Ÿ™‚

eternal oxide
#

np

flint coyote
#

Making the materials AND texts customizable does have a downside: The people using your plugin will have a harder time to tell you exactly what they did and clicked in order to reproduce an error. I'm not saying "don't do it". I just wanna add that having some Admin GUI with fixed items won't hurt anyone and will make life easier when issues occur

#

That being said - if the GUI is also for regular players admins probably want it to be adjustable.

eternal oxide
#

Yep, you'll have to be on the ball with error handling

green prism
magic glacier
#

guys

#

how to make that if i have spaces in the args[1] like for the reason "Hacking and Cheating " how to make the args[1] accept them all in the command ?

flint coyote
#

You combine args[1] with all args until args[args.length-1]

magic glacier
#

like ?

quiet ice
#

For loop with string builder

magic glacier
#

args[args.length-1]
do i write this in the code ?

remote swallow
#

will it have other stuff in the command

#

or is it /cmd Hacking and Cheating

magic glacier
remote swallow
#

does it have a player name then

magic glacier
quiet ice
#

That'd be args0

flint coyote
remote swallow
#

okay, use a string builder

quiet ice
#

But mah for loop!

remote swallow
flint coyote
#

true, unless you wanna substring args[0] after

quaint mantle
#

what are u tryna do?

quiet ice
#

Well just do asList and sublist it

flint coyote
#

or create a sub-array

magic glacier
#

StrinBuilder mew = new StringBuilder(args[1])

quiet ice
#

No

magic glacier
#

hmm

quiet ice
#

for (int i = 1 ... args.len)
builder.append(args[I]);

#

Am on my phone - it is hell to type non-abbreviated code

quaint mantle
#

what is this ?

flint coyote
#

a stacktrace

quaint mantle
#

alright

quiet ice
#

NEVER call new MyPlugin()

quaint mantle
#

but why i get this excevtion

#

ah

#

sry ๐Ÿ˜„

quiet ice
#

Also

shadow night
quiet ice
#

?whoami

shadow night
#

Why would anybody do that

quiet ice
flint coyote
quaint mantle
#

I would use packet events since it has a much nicer API

shadow night
quiet ice
#

Beginner code

flint coyote
quiet ice
#

I e. You have no idea about In avapkugin#getPlugin

quaint mantle
#

nope

shadow night
#

Isn't there some shit like Bukkit.getPluginInstance?

quiet ice
#

No

quaint mantle
#

I have a per player block system for 1.20.1 that works

quiet ice
#

But there is JavaPlugin.getPluhin(NyPlugin.class)

vapid anvil
#

so the latest release works on 1.20.1 servers?

steady rapids
#

Hi, does anyone know how to run a mc server every time the plugin is built? so I dont have to restart it manually every time

quiet ice
#

Maven-execite-plugin or something

orchid gazelle
#

wait I have been annoyed because of this a lot

#

where who when what

steady rapids
quiet ice
#

Then just use an Exec task

#

Even simpler there

remote swallow
#

use run-paper or just make a task that runs the command somewhere

steady rapids
#

I'll google for it, never did much with gradle hehe ty

quiet ice
#

JavaExec is the other opption

magic glacier
#

hacking or spamming

remote swallow
#

it will join the args up to the end of the command

#

eg you could type /report player cheats or /report player cheats and hacks and spam

#

and it would still catch it all

umbral ridge
steady rapids
#

do you guys know how to get the bounding box of a player? and the raytrace of an attacking entity?

shadow night
umbral ridge
#

Its a dumb idea I was joking xD But yeah.. just toilets. You can place them with a command and it'll create like a small toilet hut

#

so depends on the player eating and all the other factors..

#

from time to time they have to go sit in the toilet xD

#

If they dont go they will move slower and slower

#

XD

shadow night
#

Toilet hut?

#

I'll add a public toilet structure

#

You'll get nausea when you enter it

worthy moat
#

How can I remove a specific amount of items? I have for example 20 diamonds and if someone tries to byt something it should remove for example 3 diamonds of that stack

#

How could I do that?

sullen marlin
#

Inventory#remove(new ItemStack(Material.DIAMOND,3))

native bramble
sullen marlin
#

what is null

#

code looks fine

native bramble
#

item.getItemMeta().getEnchants() show me {}
enchantmentStorageMeta.hasStoredEnchants() show me false

sullen marlin
#

well does the book have the enchant stored...

native bramble
#

yeah

#

i use this cmd to get the book

#

wait

sullen marlin
#

remember enchanted book v book with enchantment are two different things

native bramble
sullen marlin
#

oh

#

CustomEnchants.MENDING_PLUS

#

custom enchants aren't supported by the API

#

so who tf knows

remote swallow
#

no way

#

md swore

native bramble
#

ohh

remote swallow
#

im telling choco

worthy moat
young knoll
#

Try removeItem instead

steady rapids
worthy moat
#

How can I give a PLayer some armor?

smoky anchor
#

define "give"

#

into inventory or to the armor slots

worthy moat
#

armor slots

smoky anchor
#

then the appropriate set methods

steady rapids
ocean hollow
#

what is the fourth argument in Quaternion responsible for?

smoky anchor
#

If you ask that, then you don't really know what the first three are for either

worthy moat
#
List<ItemStack> armorContents = new ArrayList<>();
                    armorContents.add(type.getTeamArmor(ItemManager.generateItem(Material.LEATHER_HELMET, 1, 0, itemMeta -> {
                        itemMeta.addEnchant(Enchantment.DURABILITY, 1, true);
                    })));

                    armorContents.add(itemStack);

                    armorContents.add(type.getTeamArmor(ItemManager.generateItem(Material.LEATHER_LEGGINGS, 1, 0, itemMeta -> {
                        itemMeta.addEnchant(Enchantment.DURABILITY, 1, true);
                    })));

                    armorContents.add(type.getTeamArmor(ItemManager.generateItem(Material.LEATHER_BOOTS, 1, 0, itemMeta -> {
                        itemMeta.addEnchant(Enchantment.DURABILITY, 1, true);
                    })));

                    player.getEquipment().setArmorContents((ItemStack[]) armorContents.toArray());```
#

This throws me a castException

#

How can I fix this?

smoky anchor
#

Show the exception as well

worthy moat
#
ava.lang.ClassCastException: class [Ljava.lang.Object; cannot be cast to class [Lorg.bukkit.inventory.ItemStack; ([Ljava.lang.Object; is in module java.base of loader 'bootstrap'; [Lorg.bukkit.inventory.ItemStack; is in unnamed module of loader java.net.URLClassLoader @3b764bce)
        at de.marvn.alphablock.alphawars.util.InventoryUtil.lambda$shopArmorItem$13(InventoryUtil.java:180) ~[AlphaWars-1.0-all.jar:?];```
worthy moat
green prism
# eternal oxide keeping language to a separate file would be best

Well, this is the only way I could think of so far... What do you think? (InventoriesLang#getElement gets data from a cache)

EditableElement nameUnsetElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_SETTING_NAME_UNSET);
EditableElement nameSetElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_SETTING_NAME_SET, Map.of("{companyName}", companyName));
EditableElement ownerUnsetElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_SETTING_OWNER_UNSET);
EditableElement ownerSetElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_SETTING_OWNER_SET, Map.of("{companyOwner}", owner.getName()));
EditableElement creatorConfirmElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_CONFIRM, Map.of("{companyName}", companyName, "{companyOwner}", owner.getName()));
EditableElement errorElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_VALUE_ERROR); //todo add error parameters
        
EditableElement infoElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_INFO, Map.of("{price}", String.valueOf(price)));
EditableElement priceElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_PRICE, Map.of("{price}", String.valueOf(price)));
EditableElement cancelElement = InventoriesLang.getElement(InventoriesLang.Element.CREATOR_CANCEL);
@Data
public class EditableElement {
    private String displayName;
    private String[] lore;
    private Material material;

    public EditableElement(Material material, String displayName, List<String> lore) {
        this.displayName = ChatColor.color(displayName);
        this.lore = ChatColor.color(lore);
        this.material = material;
    }
#

It's a bit of a mess, I know, but it's the only way I found to make inventories that customizable

smoky anchor
worthy moat
#

worked thx

ocean hollow
#

this method gave me chat gpt, but it still doesn't work

orchid trout
#

do team prefixes not change the player's nametag color?

glad prawn
#

we can static import right

native bramble
#

How can i have in one item CustomEnchant (which i create with EnchantmentWrapper) and spigot Enchantment?

spiral light
#

.enchant xD

green prism
echo basalt
#

For messages?

green prism
#

Inventories

echo basalt
#

Ah

green prism
#

Well yeah

echo basalt
#

If the lang is not per-player I like to do my entire inventory stuff on config

#

And then just link some actions in code

green prism
native bramble
echo basalt
#

Yea

spiral light
echo basalt
native bramble
#

Yeah, this enchant is working when solo on tool

green prism
echo basalt
#

Nope

#

I just have my own APIs for literally everything

native bramble
#

Ohh, i will try smth

green prism
echo basalt
#

And then it's as easy as registering actions

green prism
echo basalt
#

It's basically a mask

#

Where you have a line for each row

#

And a character for each item

#

And it gets the items and applies to whatever slots match the layout

green prism
#

Ohhhh, so it is a simple for Cycle, isnโ€™t it?

echo basalt
#

couple

#

There's a lot going on

#

But the end result is clean

green prism
#

Itโ€™s going to take a week

#

Wow

echo basalt
#

took me 3 hours to write this all I think

native bramble
#

What is different when i addEnchant to meta or addUnsafeEnchantment to item?

green prism
echo basalt
#

as in

#

You can't apply infinity to a pair of shears type deal

novel tangle
#

Hi, I created a custom event called BattleStartedEvent.

It is part of a jar, that my server uses as a dependency and fires from the main thread. I can listen to it from the plugin that calls the event without any problem. Now my plan is/was to have add-on plugins that can also subscribe to this event. The registerEvents is called there but when I fire the event and chase the stacktrace, only listeners from the Caller are listed as registered listeners.
I googled a lot for this issue but can't seem to find anything. Is there something needed to subscribe to other Plugins custom events?

In the plugin.yml also a depends: is configured.

echo basalt
#

No clue how you're firing the events

novel tangle
#

Created a thread for it

maiden geode
vapid anvil
#

why not just cancel the taming event for that player

maiden geode
vapid anvil
#

are you using the javadocs? there's a search function

maiden geode
eternal night
#

applyPatches generates those folders

torn shuttle
#

to be clear, there is no way via the api to modify the bounding box of an entity, right?

vast ledge
#

newer vesions?

torn shuttle
#

oh yeah... expand

#

let's give that a shot

eternal night
#

that is a copy.

#

it is not going to mutate the actual entities BB

torn shuttle
#

oh

#

well

#

that sucks

#

guess it's nms gulag with me then

native bramble
#

I have CustomEnchants class, where i create custom enchantment (minecraft:mending_plus) with EnchantmentWrapper.
When my mending_plus is solo on tool (enchant is added to tool with anvil) its works, but when i take tool with custom enchant and add with anvil another minecraft enchant, for example efficiency, my custom enchant disappears from tool. Im trying this, but it returned null:

Map<Enchantment, Integer> list1 = firstItem.getEnchantments();
Map<Enchantment, Integer> list2 = secondItem.getEnchantments();
list1.putAll(list2);
eternal oxide
#

The API does not support custom enchants

#

what is null?

native bramble
native bramble
eternal oxide
#

no

#

getEnchantments returns an immutable Map. You can;t add to it

#

Create an empty Map, then put all enchants from both

native bramble
#

ohh

#

thank u

umbral ridge
#

What is this bullshit

#

where's the error i can't see it here

#

Why does it come to this though? I entered one space randomly in an entire class and saved and now all of these red lines are gone

#

XD

compact haven
#

its just IDE spacing out

umbral ridge
#

yeah Eclipse...

compact haven
#

by saving sometimes you're re-running the analysis

umbral ridge
#

Ty

inner mulch
#

Hello, can someone help me with Player Ranks?

ocean hollow
#

can I change ItemDisplay eye line in hitbox?

spiral light
#

why should you

ocean hollow
#

for example, move it forward towards this line

tender shard
#

even the installation of eclipse sucks. "Do you wanna trust this untrusted stuff?"

#

and one can't continue if one does not trust this "Unknown" stuff

eternal oxide
#

I still prefer free with no paywall ๐Ÿ˜‰

tender shard
#

I'll give it another try, but how does one compile using maven with it?

eternal oxide
#

one sec let me open my ide

tender shard
#

"Build all" is greyed out

eternal oxide
#

Right click pom -> Run As -> Run Configurations

#

select maven build on left and click new icon at top

outer river
#

hello, i did a command which add section in config (especially data on item holded by the command sender) but i cant add 2 items in a row, i need to reload the server before add a new one, (my command ends with saveConfig() and reloadConfig() ), could you help me pls ?

eternal oxide
#

everythign shoudl be auto filled in for you, just type clean package in the Goals and then apply/run

#

give it a Name of course

#

you can then run it from teh build menu

tender shard
#

can't i just enter a goal "on the fly" without creating/editing the configuration everytime?

eternal oxide
#

yes

tender shard
#

e.g. what if I quickly wanna run mvn dependency:tree once?

#

I also don't have any autocompletion

eternal oxide
#

right click pom - Run As -> top Maven build

#

a window opens where you can select

vital sandal
#

Why esclipse :l inteliJ have a free version so

tender shard
tender shard
outer river
#
(args.length == 1 && args[0].equalsIgnoreCase("setitem") && player instanceof Player) {
                    if (player.getItemInHand().getType() != Material.AIR ) {
                        setItemConfig(player.getItemInHand());
                        main.saveConfig();
                        main.reloadConfig();
                        player.sendMessage(config.getString("Messages.Tag").replace("&", "ยง") + config.getString("Messages.Valid-Command").replace("&", "ยง"));
                    }

cant add 2 items in my config, need to /reload or it wont be safe when i execute this command

tender shard
#

I get this error on eclipse all the time?

eternal oxide
tender shard
#

it's a fresh install of latest eclipse, then I did FIle -> Import -> from Git -> entered URL -> add as general project (add as maven project was not an option)

eternal oxide
#

if its maven on git you can select teh maven section

tender shard
eternal oxide
#

thats the correct place

tender shard
#

well it doesn't do anything

eternal oxide
tender shard
#

there's no "git" in that menu, the menu is empty

eternal oxide
#

looks like somethgin is up with your install

tender shard
#

it's a completely fresh install

eternal oxide
#

sec I'll open a newer version

#

identical on my other install

tender shard
#

reinstalled it agagin, there's no "git" thingy in the maven stuff, but normally using Import from Git works fine, but then it doesn't understand it's a maven project

eternal oxide
#

I can't see discord vids ๐Ÿ˜ฆ

tender shard
#

i remember that this was the reason why I stopped using eclipse 4 years ago lol

eternal oxide
#

I can honestly say I've never seen that issue

tender shard
#

weird

#

i installed it from scratch twice

eternal oxide
#

make sure you have the M2Eclipse connector

tender shard
#

that does not exist

eternal oxide
#

its really old post, but I've never had to do it

tender shard
#

i just found there's "m2e-egit"

#

weird that it's explained nowhere and that it needs a separate thingy even though it already supports maven and git standalone

eternal oxide
#

I do remember having to install a connector years ago but I don;t remember having to in recent years

#

I wonder if it's a thing like the InteliJ bug when you cant import maven untill you have at least one maven project that was about a while back

quiet ice
# tender shard

Main issue here is that you do not have the JDT nature set up correctly

eternal oxide
#

Then only thign I've had to do on intalls recently was edit the ini file

quiet ice
#

Well this could be caused by using Eclipse JDT for Enterprise or however that variant of eclipse is called

tender shard
#

and where does one set that up?

quiet ice
#

Well it's called the Java nature

tender shard
#

it only asked me for a JDK where I left it at the default value (my already installed java17)

quiet ice
#

but truth betold the maven nature should set up the java nature so it is odd that eclipse did not auto-detect it
But then I also highly avoid this feature

tender shard
#

TL;DR eclipse didnt become any better in the last 4 years lol

quiet ice
#

using Git > Projects from git (with smart import) should usually work though

eternal oxide
#

litterally the only thing I remember doing in the past few years is edit the eclipse.ini to set a java path

eternal oxide
quiet ice
#

It auto-detects what should be used pretty fine

eternal oxide
#

its not good at importing maven

quiet ice
#

But these days I generally clone seperately

eternal oxide
#

I just Check out Maven Projects from SCM

tender shard
#

yeah after installing that "m2e-egit" thing, this works, however I'm not sure how someone is supposed to find out that this exact thing is needed, nor why it's not part of the default installation

quiet ice
#

Jesus - the "Check out maven projects from SCM" is atrocious to use. No suprise I never use that feature ๐Ÿคฃ

eternal oxide
#

No clue I remember installing it years ago but not recently. Perhaps I just forgot

#

oh interesting

quiet ice
eternal oxide
#

on a clean install with an empty clipbopard my IDE behaves as yoru Alex

#

sorry with an empty clipboard it looks to work

#

it's all blank when you have a url on your clipboard

quiet ice
eternal oxide
#

yep

#

it is a little vague though

inner mulch
#

Hello, can someone help with scoreboards and player teams?

tender shard
# quiet ice to be honest it does tell you about it

yeah but it shows a list of tons of unrelated stuff there (e.g. what's "buildhelper"?). most of these things are not "scm connectors" at all, and it also surprises me that it does support git, and maven, but not git+maven by default. also it's called "egit" and not git so one could think it's sth else than git

quiet ice
eternal oxide
#

if you want/need to use them

quiet ice
#

Because for some ungodly reason IDEs find it funny to run your maven projects in interpreted mode

tender shard
#

eclipse really makes sure to be overly annoying. in IJ you do "New file from VCS", enter the git (or whatever) URL and then it automatically sees "oh, a pom.xml - must be a maven project"

quiet ice
#

(though to be fair this means that unlikely gradle you do not have any security vulnerabilities)

quiet ice
#

Like smart import is infinitely better and I have no idea why anyone would discourage it's usage

eternal oxide
#

or you clone from git and import existing maven

quiet ice
#

that is best ofc

tender shard
quiet ice
#

I wasn't part of the convo back then

quiet ice
#

Okay after downloading the m2e-git plugin the materialize from SCM way also works but I still don't like it because compared to smart import it does not show you what exactly you are importing and gives you less control over it

#

Also pro tip: You can add the maven nature to any project after the fact by right clicking on the project, then going on configure and pressing on "Convert to maven project". If a pom is present, it will automatically set up all natures without a fuzz - otherwise it will ask you some basic information to generate the pom for you

#

Another pro tip: Use the project editor instead of the package editor - to this day I don't really understand why the former isn't the default.

But the differences are minor outside a multi-project setup

last abyss
#

Hi !, i don't really understand the usefulness of the file config.yml ?

quiet ice
#

Well then you don't need it

tender shard
#

then you don't have to use it

last abyss
#

really, thanks because i throw that was not really useful but a lot of classes explain it and use it

eternal oxide
#

interestign installing that m2e-git plugin broke my 2022-06 ide ๐Ÿ˜ฆ

quiet ice
#

Wow, you are a whole year behind

onyx fjord
#

ij 2023 isnt the most stable experience

quiet ice
#

I know some people are still stuck on Eclipse Oxygen (or was it Neon?) but those do it because they don't have another choice (i.e. newer Eclipse releases don't support Java 7- debugging)

eternal oxide
#

can;t even rollback. it broke the transport layer

quiet ice
#

Guess you may need to manually yoink the plugin from the plugins dir

eternal oxide
#

I'll probably just wipe and install a fresh as I use no customization

quiet ice
#

I have at least a dozen plugins that I forget to reinstall after reinstalling eclipse (such as the checkstyle integration, the (absolutely trash that I should probably fork) decompiler plugin or syntax highlighting plugins for various languages such as JSON)

tender shard
scarlet ridge
#

hello! so im very much a newbie in terms of looking at minecrafts code and figuring stuff out, and i want to see on a 1.20 spigot server how lets say a shulker box is compressed. ive been told its under net/minecraft/nbt/NBTCompressedStreamTools.java, but i cant seem to find it in this file either. any help would be appreciated lol

tender shard
#

the class is called NbtIo

#

net.minecraft.nbt.NbtIo

#

in mojang maps

scarlet ridge
#

i cant find that on spigot tho

tender shard
#

do you have the remapped spigot version?

shadow night
#

Nbtlo?

stoic glade
#

does anyone here know which enum to send in "ClientboundPlayerInfoUpdatePacket" to add a new entity to the client list?

#

1.20.1

scarlet ridge
tender shard
#

run buildtools with --remapped, then you get the mojang mapped classes

shadow night
tender shard
shadow night
#

I'm stupid lol

shadow night
#

But tbf I don't really care at this point

scarlet ridge
#

i looked at Spigot/Spigot-Server/src/main/java/net/minecraft/nbt

#

and it doesnt seem to be there

wise mesa
#

It installs it into your maven

#

Now you just need to adjust your Pom

scarlet ridge
#

aaaaaaaa i never did java before aaaaaaaaaaaaa

#

gotta look up a tutorial ig

#

i have no experience in anything other than c ๐Ÿ™‚

scarlet ridge
#

i mean i know how to read java code

#

like i understand it

#

and thats about it

shadow night
#

Well, you'd need to learn naming conventions, keywords and other java stuff

#

Since you are familiar with programming, it shouldn't be hard

torn shuttle
#

it's one of those days

shadow night
#

Lol

grim oak
#

Hi, Ive created a custom boss and im wondering how do i add a boss bar for it? and when the boss takes damage do i manually need to update it or will it update itself?

torn shuttle
#

using records for the first time, exciting stuff

#

this ain't java 8 no more

ocean hollow
#

how can i make it smoother with teleports? For example, if I move an entity by 0.1 every tick, it turns out to be twitchy.

#
  • this is about Display Entity, like others move smoothly
icy beacon
torn shuttle
icy beacon
#

saves you from hardcoding even though it's still kinda hardcoding haha

#

but not exactly

torn shuttle
#

the other half would be way too complex to make configurable

icy beacon
#

but yes

icy beacon
torn shuttle
#

or at least to make it worthwhile

worthy moat
#

How can I color Peoples name and they cant hit the people in their own team? Its for bedwars

echo basalt
#

1 - scoreboard teams

#

2 - make an event handler

#

if you're making a minigame plugin we expect you to know the basics

worthy moat
echo basalt
#

You..

#

Should start with something basic and grow up to a minigame

smoky anchor
magic glacier
#

Cannot invoke "java.sql.Connection.createStatement()" because "connection" is null

why im getting this error

hazy parrot
#

Because "connection" is null

magic glacier
#

i have checked every thing in the connection

worthy moat
magic glacier
#

and also getting this
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

#

even i have installed the jar

#

of mysql-connector

#

and put it in the build path

#

and also tried maven

hazy parrot
#

Have you tried using Google

#

Because it's common problem

magic glacier
hazy parrot
#

You were using class.forName?

magic glacier
#

install mysql-connector.jar done
install mysql-connector from maven done

magic glacier
hazy parrot
#

Show code

#

And your pom

magic glacier
#

public void connectToSql() {
try {
synchronized (this) {
if(getConnection() != null && getConnection().isClosed()) {
return;
}
this.getLogger().info(Translate.connection_msg);
Class.forName("com.mysql.jdbc.Driver");
this.setConnection(DriverManager.getConnection("jdbc:mysql://localhost:3306/cat", "cat", "sdmdfsdfsdfs"));
db = getConnection().createStatement();
}
} catch(SQLException e) {
System.out.println(e);
} catch (ClassNotFoundException e) {
System.out.println(e);
}
}

eternal night
#

if you are shading the latest mysql driver, that is the wrong class

magic glacier
eternal night
#

com.mysql.cj.jdbc.Driver

magic glacier
#

i will try that

magic glacier
eternal night
#

what is the error

magic glacier
#

java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver

eternal night
#

are you relocating ?

magic glacier
#

i don't think so

eternal night
#

what mysql driver are you shading

ocean hollow
magic glacier
eternal night
#

share your pom.xml pls ๐Ÿ™‚

#

?paste

undone axleBOT
magic glacier
eternal night
#

oh

#

you are not using any build system ?

magic glacier
#

im using the default with intellij idea

eternal night
#

I'd highly highly recommend checking out either maven or gradle

#

to define all of this via files instead of intellij configuration values

smoky anchor
ruby lynx
#

quick question what value does getWalkSpeed return when the player has no effects?

#

bing answered faster than yall

eternal night
#

Who in their right mind asks a support chat before trying to find the answer on a search engine kekw

ruby lynx
#

and i dont use microsoft edge

#

so i had to open it

#

but my lazy ass didnt want to

upper hazel
#

tell me why my plugin to search for a specific zone creates a lot of some files in the world/region when the plugin is launched

does it have something to do with worldguard?

#

after a sharp shutdown of the PC, some kind of error appeared in 1 file and I deleted it

#

before this worldguard rampaged in the console

vapid verge
#

Asking again just in case, anyone familiar with unit testing their plugins? Specifically with mockito and maybe mockbukkit?

maiden geode
upper hazel
maiden geode
#

I just called the event and cancelled it

remote swallow
ruby lynx
#

venmo?

remote swallow
#

no

ruby lynx
#

alr then no money for you

remote swallow
#

i somehow doubt many people that give help here use venmo

maiden geode
# upper hazel this work maybe you have mistake
package com.justxdude.islandcore.listeners;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityTameEvent;

public class testListener implements Listener {
    @EventHandler
    public void test(EntityTameEvent e) {
        e.setCancelled(true);
    }
}

Literally, registered it of course...

#

Yeah, it's fired after taming occured... :V

ocean hollow
golden turret
#

does someone know how to fix this? My IJ is stuck in the "Loading indexes" part. I already deleted the .gradle and .idea but it didnt solve it

smoky anchor
tender shard
zenith gate
autumn cave
#

I'm trying to rotate an ItemDisplay using the player's direction. But the x, y, and or z rotation axies are always messed up, I tried -, flipping them around, but there is always at least one axis that is wrong:

val direction = player.eyeLocation.direction
val direction3f = Vector3f(direction.x.toFloat(), direction.y.toFloat(), direction.z.toFloat())
val up = Vector3f(0f, 1f, 0f).normalize()

val leftRotation = Quaternionf().lookAlong(direction3f, up)
val rightRotation = Quaternionf()

val scale = Vector3f(1.0f, 1.0f, 1.0f)
val translation = Vector3f()

val transformation = Transformation(translation, leftRotation, scale, rightRotation)
ornate patio
#

is there an entity collision event

eternal oxide
#

no

river oracle
#

why isn't gradle picking up the class I just added to another submodule implemented by this one

#

Its so annoying

#

I've tried refreshign and restarting no luck. Still no luck I hate gradle

quaint mantle
#

u guys suggest mongodb for spigotapi ?

#

or mysql better ?

eternal night
#

choose the right tool for the job

#

depends entirely on your data

quaint mantle
#

i don't understand mongedb i store datas in json ?

river oracle
#

the database you choose should reflect the data you need to store

ivory sleet
#

well technically its Bson

#

but samething in principle

quaint mantle
#

example unique id

#

and mongodb creating id,

river oracle
#

Bson supports Unique IDs

river oracle
#

Bson supports more data types than MySQL

#

you throw entire world files in those documents and it handles it very well

eternal night
#

postgres supremacy

quaint mantle
#

alright

#

btw

#

is this database types ?

river oracle
#

Is there a way to refresh dependencies in gradle? I seriously wanna cry righta bout now can't find what I need on google either ๐Ÿ˜ญ I just want the new class I added to work without having to fucking refresh everything. This takes 2 seconds on maven

eternal night
#

IJ has an option

#

open the gradle tab on the right

#

right click your top module

river oracle
eternal night
#

"Refresh gradle dependencies"

#

WWell, you can try the --refresh-dependencies flag on the wrapper ?

river oracle
#

GAHHH I was on a streak I've been using gradle for like every project this is the closest I'm getting to going back to maven like wtf it should just work like it does on maven

eternal night
#

I mean, --refresh-dependencies is just -U in gradle

river oracle
#

with maven I don't even need to refresh

eternal night
#

maven certainly also needs refreshes

river oracle
eternal night
#

if you are using a snapshot dependency, both maven and gradle are going to cache it locally for a configurable timespan

#

neither in gradle

river oracle
#

then why won't it detect?

#

I'll try invalidating caches I guess

eternal night
#

I feel like you are doing the multi module wrong

#

can you share the consuming modules build.gradle.kts

#

e.g. the module that depends on the other module

worthy moat
#

How can I check if a block was blown up by tnt so I can cancel the block?

river oracle
#

invalidating caches fixed it

eternal night
#

hmm yea no that should be fine yea

river oracle
#

idk wtf IntelliJ cached but ๐Ÿคทโ€โ™‚๏ธ

warm mica
#

Each does something vastly different

river oracle
ivory sleet
#

fr

river oracle
#

groovy ftw

#

its less horrifying than the scuff that is kotlin

#

groovy reminds me of spicy python lol

ivory sleet
river oracle
river oracle
# ivory sleet u goofy

as Originally a Python dev I rather learn Spicy Python than Java's malformed baby brother

ivory sleet
#

lol "malformed baby brother"

nova notch
#
Title.Times times = Title.Times.times(Duration.ofMillis(fadeIn*50), Duration.ofMillis(duration*50), Duration.ofMillis(fadeOut*50));

        if (Objects.equals(mainTitle, "")) {
            players.sendTitlePart(TitlePart.SUBTITLE, Component.text(subtitle));
            return;
        }
        if (Objects.equals(subtitle, "")) {
            players.sendTitlePart(TitlePart.TITLE, Component.text(mainTitle));
            return;
        }
        Title title = Title.title(Component.text(mainTitle), Component.text(subtitle), times);
        players.showTitle(title);```
how do i apply the times to a title part? it only lets me do the title part and text component
river oracle
chrome beacon
#

Are you using reflection or smth

river oracle
#

that's the aforementioned line

chrome beacon
#

Try using getHandle instead of just handle

#

I don't think you have access to that field

worldly ingot
#

Paper Discord will help you better

nova notch
#

oh ok

opal verge
#

What is the 1.20.1 nms maven dependency?

chrome beacon
#

?nms

river oracle
chrome beacon
chrome beacon
#

1 sec let me check

river oracle
#

so confusing

opal verge
chrome beacon
chrome beacon
river oracle
chrome beacon
#

๐Ÿ’€

opal verge
eternal oxide
#

?bt

undone axleBOT
chrome beacon
river oracle
#

What's the difference between getField and getDeclaredField again

chrome beacon
#

Not sure actually

#

I do know that getDeclaredField works most of the time

#

If it doesn't then you use the other method

eternal night
river oracle
#

ahk

opal verge
#

So now when I refresh maven I get this Could not find artifact org.spigotmc:spigot:jar:remapped-mojang:1.20.1-R0.1-SNAPSHOT

#

If I comment out this in my pom.xml it works <classifier>remapped-mojang</classifier> but I can't build it like that

worthy moat
#

How can I make the player face a specific Block?

hybrid tundra
#

got this while updated LostSkyWars plugin from 1.8 to 1.20

gleaming grove
#

Is there any smart mathematician that can explain how can I understand leftRotation and rightRotation rotations? Why there is not just one property for rotation? Also how can I convert given rotation in Vector3(x,y,z) to those leftRotation and rightRotation Quaternions?

tender shard
hybrid spoke
#

same here, i just gave it a custom scale and changed the rotation via its location

#

none of that is really documented either

#

maybe check the minecraft updates n stuff

gleaming grove
#

At the time being I only find out that Transformation is later converted to Matrix4 that is used by OpenGl to render stuff

shadow night
#

Martix4?

gleaming grove
#

its just class that holds flaot[4][4]

shadow night
#

Makes sense ig

#

Ah yes, my favourite type, flaot

#

I love flaoting points

shadow night
#

de-de

#

sus

gleaming grove
#

/summon block_display ~-0.5 ~-0.5 ~-0.5 {Passengers:[{id:"minecraft:block_display",block_state:{Name:"minecraft:acacia_fence",Properties:{}},transformation:[1.0000f,0.0000f,0.0000f,0.0000f,0.0000f,0.7071f,0.7071f,0.0000f,0.0000f,-0.7071f,0.7071f,0.0000f,0.0000f,0.0000f,0.0000f,1.0000f]}]} Here is example of loading transformation as Matrix4

#

I found some article about Transformations in OpenGL, RightRotation is OrginalVector whatever that means

hybrid spoke
#

chatgpt knows shit

#

you could ask it

sullen marlin
#

Easier to just use the 3 components rather than try and make a 4x4 matrix

gleaming grove
gleaming grove
sullen marlin
#

No idea

#

Can probably leave as zero

eternal oxide
#

isn;t left and right just the order in which translations are applied?

sullen marlin
#

I guess it's just how quaternions work

eternal oxide
#

Its been a few years since I messed around with quaternions (for a space game) but if I get time tomorrow I'll have a play with displays

umbral ridge
#

Are there any particles that can be custom colored

#

with a hex or just default color

worldly ingot
#

Redstone dust is really the only one that comes to mind

#

I guess maybe splash particles too. The only other one is notes but I don't think you can control the RGB on that

umbral ridge
#

So that's why it requires additional data!

#

Was questioning myself before

worldly ingot
#

Well, "requires", yeah. It's optional

umbral ridge
#

Oh no it would not let me spawn it without additional data

#

Thank you :D

next stratus
#

How do you make a pull request to spigot?

remote swallow
#

?contribute

worldly ingot
#

PRs are appreciated but if you don't feel comfortable signing the CLA, at least a JIRA issue goes a long way

next stratus
#

Why does it need the mobile number? ๐Ÿค”

#

I mean, my feature I wrote is only like 8 lines long ๐Ÿ˜…

worldly ingot
sullen marlin
#

The sniper needs you to pick up the phone before he can dramatically shoot you

worldly ingot
#

That's the secondary reason

#

Your PRs are of higher quality when the sniper laser's pointed right at your forehead

remote swallow
#

what about the kangaroo working for the dod that tracks ur mobile to come say hi

next stratus
#

I mean, if you need to contact someone wouldn't you just message them on discord?

umbral ridge
#

How do you make a player bounce off (that i've implemented), from a certain location? BUT on PlayerMoveEvent, also with cancelling support. For some reason if I cancel the event, the bounce off thing doesn't work, I just vectorize the player location and invert it..

Eg. player is trying to enter a region that they shouldn't ented and on the border, as soon as they walk into it, I bounce them off, however it's kinda glitchy, without multiplying the vector the player can just glitch in the region, because I can't cancel the event and bounce the player back in inverse location at the same time (if i cancel the playermoveevent, nothing happens, as if i didnt bounce the player back)

So how is this normally handled and how it should be handled? with bouncing the player back thing?

remote swallow
#

i doubt its to actually contact you, that would be done on the pr or by email most likey, id say its probably legal stuff

next stratus
#

Personally that's what'd likely put me off contributing sadly. On Paper you can just make a github pull request and it's all good but with spigot you have to put your mobile number in etc of which is slightly iffy. I do trust you guys but I don't even give my numbers out to my friends lol.

remote swallow
#

blame the dmca

#

?dmca

undone axleBOT
marsh lichen
#

the DMCA of 2014 D:

#

Like mostly everyone was upset when bukkit and spigot got hit :/

next stratus
#

I honestly don't know what to do now. Here's me thinking "oh that'll be a quick 5 min pull request" now I gotta sign forms etc

sullen marlin
#

CLAs aren't exactly uncommon

umbral ridge
#

How do you run a command in the chat as a player again?

#

dispatchCommand or something? was it?

remote swallow
#

Bukkit.dispatchCommad or player.chat

umbral ridge
#

Also, any good guide/ on multi-paged GUIs? It's the best to implement it myself?

#

or just use an already existing util class or something

#

idk if there is one

chrome beacon
#

There are many libs you can use

marsh lichen
#

Want to clear all sniffer locations.

umbral ridge
#

I don't want to spend a few days writing it

#

handling everything

chrome beacon
#

IF

#

(InventoryFramework)

umbral ridge
#

Thank you!

rare rover
#

this seems very janky, is there a way i can improve it?

    @Override
    public @NotNull Map<Material, List<PlayerGenerator>> convertGenerators(@NotNull PlayerData data) {
        Map<Material, List<PlayerGenerator>> formattedGenerators = new HashMap<>();

        PlayerData.Data playerData = data.getData();
        List<PlayerGenerator> generators = playerData.getGenerators();
        if (generators.isEmpty()) {
            return formattedGenerators;
        }

        for (PlayerGenerator generator : generators) {
            PlaceableGenerator placeableGenerator = (PlaceableGenerator) generator;
            Block block = placeableGenerator.getBlock();
            Material blockType = block.getType();

            List<PlayerGenerator> matchingGenerators = generators.stream()
                    .filter(g -> ((RegisteredGenerator) g).getRegisterable().getDropItem().getType().equals(blockType))
                    .collect(Collectors.toList());

            formattedGenerators.put(blockType, matchingGenerators);
        }

        return formattedGenerators;
    }```
#

like 0 way i'm keeping this

#

๐Ÿ’€

onyx fjord
#

but thats not optimal

carmine mica
onyx fjord
#

i havent found a cla that asks me for my address or phone number before

#

on github its just usually sending a message in the pull request

carmine mica
#

I canโ€™t speak to how often certain info is asked for in CLA, but Iโ€™ve seen plenty of repos that have tools that make sure the author has signed it

onyx fjord
#

usually first an last name

#

and thats it

flint jay
#

I'm trying to set up a playtime objective, but failing
On enable,

if(scoreboard.getObjective("playtime") == null){
  scoreboard.registerNewObjective("playtime", Criteria.statistic(Statistic.PLAY_ONE_MINUTE, EntityType.PLAYER), mm.deserialize("playtime"));
}
this.playtime = scoreboard.getObjective("playtime");

on player join,

Score playtimeScore = playtime.getScore(player.getName());
if(!playtimeScore.isScoreSet())
    playtimeScore.setScore(0);

I'm guessing it has something to do with statistics criteria, because other objectives work properly

The score stays at zero

#

I also tried it without the EntityType.PLAYER

worldly ingot
#

Yeah you shouldn't need the EntityType for that

#

Criteria.statistic(Statistic.PLAY_ONE_MINUTE) should work fine

#

Also, I'm doubtful this would work onEnable() because you can't do anything with scoreboards while plugins are enabling. There is no scoreboard manager.

nocturne forge
#

im making an rtp gui and when i click an item in the gui, i get random teleported, anyways when i use:
player.closeInventory();
Bukkit.getScheduler().runTaskAsynchronously(this, () -> {
teleportPlayerRandomly(player);
});
it just closes my inventory, but doesnt rtp (yes rtp should work i alr have the function) anyways when i use:
teleportPlayerRandomly(player);
player.closeInventory();
it works. How do i fix this, i want to use asynch since it reduces the lag when i press the item in the gui and the rtp itself.

young knoll
#

Are there any errors

nocturne forge
#

nope

#

asynch does make the item click into the next indent of commands faster (or however you say it) but it just closes the menu, doesnt rtp at all

inner mulch
#

is here someone that is a pro in setting up scoreboards? (i got some issues with mine)

orchid trout
#

?ask

undone axleBOT
#

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

glass mauve
inner mulch
#

ok, so

#

i got teams on my server and once i apply a newscoreboard for every player, only the player can see their own rank, but not the other players

orchid trout
#

?nocode

undone axleBOT
#

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

orchid trout
#

?paste

undone axleBOT
inner mulch
#

bro :(

#

ok wait

orchid trout
#

who cares about effort

undone axleBOT
#

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

inner mulch
orchid trout
#

ty

#

im pretty sure all players have to use the same scoreboard

#

unless you are doing stuff with packets so that your teammates are green and enemies are red

inner mulch
#

how do i display personal stuff like money on the scoreboard?

#

if everyone has the same scoreboard

#

then i cannot display personal data

nocturne forge
inner mulch
#

wdym by that?

nocturne forge
#

for example {Player} for the player or whatever dont tell me if im wrong, anyways for example u have an economy plugin, it basically uses these for example {eco} (now again dont tell me that im wrong because i know i suck at java) but not all have the same ones

#

one could have {economy}

#

one could have {money}

#

one can have {balance}

#

but still i dont know if you use curly brackets for this

inner mulch
#

the thing is if they share a scoreboard, it does not display their individual stats

inner mulch
#

it displays the stats of the last player that applied their stats to it

nocturne forge
#

thanks

#

i recently got into java

#

thats why

#

i dont know the basics

orchid trout
#

then dont try to help

inner mulch
#

crackma

#

can you help me?

orchid trout
#

idk

inner mulch
#

ok :(

nocturne forge
#

alr

inner mulch
#

:(

#

im going insane

#

i am stuck on this for 3 days

orchid trout
#

try making a thread

#

and putting the link in here every now and then

#

if you have teams like admin and moderator, each scoreboard has to have them as well

#

for players to see them

inner mulch
#

so i have to register them there too?

orchid trout
#

while having different sidebars

#

yeah

#

try that

inner mulch
#

the sad part is im creating teams for each individual player

orchid trout
#

ohh

inner mulch
#

with an algorithm

orchid trout
#

you have to create the teams on every scoreboard

#

and add each players in the correct teams

#

idk if that was clear

inner mulch
#

but if i add the player to a team from a different scoreboard, wouldnt that not work?

orchid trout
#

the player doesnt have to have that scoreboard

#

it just has to be in the scoreboard's team's entry list

#

entry array

#

idk

inner mulch
#

ok

orchid trout
#

just read the thread's answers

inner mulch
#

ok, thank you

orchid trout
#

the OP has the exact same issue as you

#

np

nocturne forge
#

how to i stop my rtp from teleporting into water

inner mulch
rough ibex
#

if the block below is air keep checking until you hit !air && !water

nocturne forge
young knoll
#

You can also speed things up by having RTP ignore water biomes

#

Like oceans

orchid trout
#

would make more sense to write player instead of onlinePlayers

rough ibex
#

it's basic programming

nocturne forge
#

most of them

rough ibex
#

!learnjava

#

?learnjava

undone axleBOT
tall furnace
#

Go through at least just the beginner series, it can be done in half a day.

nocturne forge
#

im gonna try learning it tomorrow

#

well

#

today

crude charm
nocturne forge
#

or just some of the basics

crude charm
#

You learn java before spigot

#

spigot is an API, an addition to the base of Java

#

You should know you can't replace a String by simply entering an entry with brackets

nocturne forge
#

i just asked if he meant all basics of java or just some of the basics of java

nocturne forge
crude charm
#

they are basic

#

basic basics

nocturne forge
nocturne forge
crude charm
nocturne forge
#

and making plugins is not as messy as having to configure files and having multiple commands to make multiple gui's just to make a "next page" button

nocturne forge
zenith gate
#

how accurate is isSimilar? if I have a custom item, but then someone puts an enchant on it, witll the isSimiliar still return true or false?

young knoll
#

False

zenith gate
#

Thats what i thought ok.

young knoll
#

Iirc isSimilar is just equals but ignoring stack size

zenith gate
#

ugh okay, I think it would work better in my mention way above, but I guess that makes sense.

young knoll
#

Tis why pdc is nice

#

You can just compare a pdc entry to identify an item

zenith gate
#

Yeah I know I use pdc all the time, I just hate having to constantly create keys. I always forget and Fleet sometimes likes to be stupid and not tell me that i forgot.

fervent robin
#

fleet for java??

young knoll
#

Just make all your keys once and store them in a constants class

zenith gate
zenith gate
fervent robin
#

i tried it but the smart code or the intelli sense what ever its called is super buggy

zenith gate
#

Yeah it is. it still is. not as bad anymore though.

#

I only use it because its super lightweight. Runs well on my macbook. Which struggles with intellij sometimes.

#

?paste

undone axleBOT
zenith gate
young knoll
#

Did ya register both your events and the libraries events

zenith gate
#

oh shit i forgot abt the library events.

young knoll
zenith gate
#

I know ๐Ÿ˜ข I recently restarted my project and used oold code from before. I just forgot abt that.

prime epoch
#

does anyone know why this is spamming my console with errors?

public class OnPlayerMoveEvent implements Listener {
//    public Hashtable<UUID, Location> player_last_location = new Hashtable<UUID, Location>();

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        Player p = event.getPlayer();
        if (p == null) return;

        if (event.getFrom().getX() == event.getTo().getX() && event.getFrom().getZ() == event.getTo().getZ()) return;


        // cancel home timer if they move
        if (CooldownManager.hasHomeTimer(p.getUniqueId())) {
            CooldownManager.cancelHomeTimer(p);
        }
        if (CooldownManager.hasLogoutTimer(p)) {
            CooldownManager.cancelLogoutTimer(p);
        }

        ClaimsManager.relayPlayerInClaim(p);

    }

}
``` ```
18.07 04:28:17 [Server] [ERROR] Could not pass event PlayerMoveEvent to hcfcore v1.0-SNAPSHOT
18.07 04:28:17 [Server] [INFO] org.bukkit.event.EventException: null
18.07 04:28:17 [Server] [INFO] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

gray talon
#

not half of it

prime epoch
#
18.07 04:28:17 [Server] [ERROR] Could not pass event PlayerMoveEvent to hcfcore v1.0-SNAPSHOT
18.07 04:28:17 [Server] [INFO] org.bukkit.event.EventException: null
18.07 04:28:17 [Server] [INFO] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:270) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at net.minecraft.server.v1_8_R3.PacketPlayInFlying.a(SourceFile:126) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at net.minecraft.server.v1_8_R3.PacketPlayInFlying$PacketPlayInPosition.a(SourceFile:57) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
#
18.07 04:28:17 [Server] [INFO] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:17 [Server] [INFO] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]
18.07 04:28:17 [Server] [INFO] Caused by: java.lang.NullPointerException
18.07 04:28:17 [Server] [INFO] at org.ayple.hcfcore.core.claims.ClaimsManager.relayPlayerInClaim(ClaimsManager.java:147) ~[?:?]
18.07 04:28:17 [Server] [INFO] at org.ayple.hcfcore.events.OnPlayerMoveEvent.onPlayerMove(OnPlayerMoveEvent.java:46) ~[?:?]
18.07 04:28:17 [Server] [INFO] at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) ~[?:?]
18.07 04:28:20 [Server] [INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_292]
18.07 04:28:20 [Server] [INFO] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_292]
18.07 04:28:20 [Server] [INFO] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
18.07 04:28:20 [Server] [INFO] ... 15 more```
gray talon
#

ClaimsManager.relayPlayerInClaim(p);

#

this line has error

prime epoch
#

oh shit i didnt even see that

#

alr thanks

quaint mantle
#

if im comparing 2 invs i need to implement inventory holder?

grave kayak
sterile breach
#

Hi, someon have a tutorial for pagnited gui?

sinful stag
#

Iโ€™d suggest you to make your own library, makes it simpler to understand

sterile breach
sinful stag
#

Then I donโ€™t think there are tutorials for paginated menus out there

#

To make your own system you can try to imagine it first, or insipide yourself from other libraries and how they did it

smoky anchor
grave kayak
# smoky anchor I hope you have improved the code with my suggestions from yesterday. Anyways, w...

yes yes i have -> https://pastebin.com/nNaTP9av. when i click the back button on the enchantment menu it is not returning to the tool menu of the players selected tool. it was working previously but i had to change the code for the person who needs it and then of course change it back to how i had it originally.. when i click the back button literally nothing happens and there is no console errors or anything

smoky anchor
#

Hmm.. have you tried debugging it ?
Like putting printouts everywhere :D
Are you sure the slot ids are correct ?

#

Also, the ToolMenu is missing @Overrides (That is not the source of your problem tho)

grave kayak
small holly
#

Hey so I am wanting to set a block facing a player (dispenser in this exact situation but will be others) how can I get direction based off block face? (They click on a dispenser and I want it to cancel the opening of the GUI and just set the block facing them)

#

or like is there some way to turn a player direction into a block face direction?

smoky anchor
#

I think there was a method specifically for this

small holly
#

Im stuck in 1.8 currently so im not sure if there is lol

sullen canyon
small holly
#

well I can get the pitch and yaw and the direction vector

sullen canyon
#

There was a method in nms to know where the player is facing with blockface or smth like that, unfortunately I can not help a lot since I am unable to use my pc anymore and all what I have is my phone

#

You simply need to look through player's class to see if there is anything you could use to know the direction as blockface

#

or just ask chatgpt, it will be more helpful then me lol

small holly
#

CraftPlayer or?

small holly
echo basalt
#

It's just a list of itemstacks and a method to render a page

buoyant viper
#

?pdc for self bc i never used them n want 2 use them for something

echo basalt
#

That just segments the list

small holly
buoyant viper
#

this should work as a pdc wrapper, right?

#

actually maybe i should make a wrapper that gets instantiated builder-style

eternal oxide
#

look back a couple of days. mfnalex posted a nice pdc wrapper in here

buoyant viper
#

this, ye?

eternal oxide
#

yep

echo basalt
#

Just google "spigot player direction block face"

chilly hearth
#

a

#

how can i register 2 commands

#
        getCommand("ancient").setExecutor(new bosscommand());
        getCommand("reaper").setExecutor(new bosscommand2());
#

that gives me error

shadow night
#

What error

chilly hearth
#

wait

vapid anvil
#

did you know that if you send a player a sufficiently fucked up chunk data packet you can crash their entire client

chilly hearth
#

cant resolve the symbol

#

its in red

shadow night
#

Post the full error

chilly hearth
#

its the full error ;-;

#

it says create a inner class

#

but i already have an class

vapid anvil
#

which symbol can't it resolve

chilly hearth
#

named bosscommand 2

echo basalt
chilly hearth
#

xd

shadow night
vapid anvil
#

๐Ÿ’€

chilly hearth
#

how to post the log ;-;

shadow night
#

._.

vapid anvil
#

that is pretty funny though

#

any server can on-demand crash your client

shadow night
#

Obv

chilly hearth
#

how ca i

tender shard
shadow night
tender shard
#

the fields declared in PersistentDataType obviously are of type PersistentDataType and not of Type

shadow night
#

Well, where does it show an error

tender shard
chilly hearth
#

OHH

#

U WANT ME TO RUN IOT

smoky anchor
#

Do you have bosscommand2 ?
Also for the love of fuck, use the java conventions
What is the command for it guys

buoyant viper
#

true

chilly hearth
#

i do

shadow night
chilly hearth
#

error

#

is

#

Cant resolve the symbol 'bosscommand2'

#

boom

#

thats the error