#help-development

1 messages Β· Page 2254 of 1

old turtle
#

should all custom items have their own key?

earnest forum
#

yes

#

when u do /give it shows minecraft:stone_bricks

quaint mantle
#

Help pls

earnest forum
#

minecraft:stone_bricks is the namespace key

old turtle
#

ohh i see

earnest forum
#

if ur doing forge modding

#

it would be

#

urmodname:custom_item

#

everything in minecraft has a key

#

minecraft:stone_bricks
^^^^ ^^^^^^^^^^
name key
space

coral pilot
#

can i change the tracking range of specific entities at runtime?

river oracle
#

I'm not certain there is api for this but if you dig around nms I think you should find something

#

By tracking range what do you mean. Are you talking about agro range?

coral pilot
#

no

#

tracking range = range where entities get send to the player

river oracle
#

That's agro range

#

Lol okay yea you can change that with nms

#

There are apis that make thag wider too

quaint mantle
#

plss help

earnest forum
#

?learnjava

undone axleBOT
earnest forum
#

you've obviously just copied this from a tutorial

dull atlas
#

Hello, I've been trying to get player's group from the plugin GroupManager. Before explaining, I do not wish to use LuckyPerms due to very bad experience... unless it's my last solution.

Anyway, I had multiple ways to get a player group, and all worked perfectly + my plugin works fine.
But out of no where, Essentials X (Chat) is crashing and cannot synchronise the chat anymore which results in the loss of chat formating (prefix/suffix).
At first I thought it was because my plugin was sending commands on the console, so instead I went with Group Manager files/configs.
But somehow, EssentialsX Chat is capable of detecting any interaction I am doing with Group Manager and crash upon it.

org.bukkit.event.EventException: null```

For exemple, I wrote a line to get GroupManager plugin from Bukkit and just that crash the chat formatting:
`Bukkit.getPluginManager().getPlugin("GroupManager");`

My only solution now is to get the users.yml file by hand with a string path. But I am not quite sure it's gonna be responsive whenever a player change groups.
It's probably a server related problem or Essentials version, but I changed servers and version quite a lot and nothing.
If needed

Any help, suggestions or fix solutions would be appreciated.
eternal night
#

can you provide more of the stack trace

dull atlas
#

Surely

#
org.bukkit.event.EventException: null
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:303) ~[forge:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[forge:?]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[forge:?]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:588) ~[forge:?]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:570) ~[forge:?]
        at net.minecraft.network.play.ServerPlayNetHandler.chat(ServerPlayNetHandler.java:1758) ~[?:?]
        at net.minecraft.network.play.ServerPlayNetHandler.func_147354_a(ServerPlayNetHandler.java:1686) ~[?:?]
        at net.minecraft.network.play.client.CChatMessagePacket.lambda$handle$0(CChatMessagePacket.java:35) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
        at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "org.anjocaido.groupmanager.GroupManager.getWorldsHolder()" because "this.groupManager" is null
        at net.milkbowl.vault.chat.plugins.Chat_GroupManager.getPlayerPrefix(Chat_GroupManager.java:272) ~[?:?]
        at net.milkbowl.vault.chat.Chat.getPlayerPrefix(Chat.java:67) ~[?:?]
        at net.milkbowl.vault.chat.Chat.getPlayerPrefix(Chat.java:91) ~[?:?]
        at com.earth2me.essentials.perm.impl.AbstractVaultHandler.getPrefix(AbstractVaultHandler.java:51) ~[?:?]
        at com.earth2me.essentials.perm.PermissionsHandler.getPrefix(PermissionsHandler.java:88) ~[?:?]
        at com.earth2me.essentials.User.getNick(User.java:484) ~[?:?]
        at com.earth2me.essentials.User.getNick(User.java:443) ~[?:?]
        at com.earth2me.essentials.User.setDisplayNick(User.java:509) ~[?:?]
        at com.earth2me.essentials.EssentialsPlayerListener.onPlayerChat(EssentialsPlayerListener.java:188) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) ~[forge:?]
        ... 12 more```
#

Similar stack trace happens with other lines of code, this is one of few examples

lost matrix
eternal night
#

What exactly are you doing on your end to group manager ?

#

Yea but it is vault failing there

quaint mantle
#

Can someone help

#

?

dull atlas
lost matrix
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!

quaint mantle
#

I kept posting my question

#

No one wants to help

#

I am getting this error

eternal night
#

Mate, your question is literally "pls tell me what imports I need because I am too lazy to figure it out"

#

the plugin variable you reference is just never defined as a field

dull atlas
quaint mantle
#

Cannot find symbol variable plugin

eternal night
#

Well, vault should be properly hooking

#

is vault hooking ? group manager

lost matrix
dull atlas
quaint mantle
#

But

#

Still the same issue

dull atlas
lost matrix
eternal night
#

if vault properly hooks, you should see a info log in your console

lost matrix
dull atlas
#

Nope

eternal night
#

and yes they have spigot api. Their java code just

#

is bad

quaint mantle
#

This is why I am confused

eternal night
#

why the fuck does vault not add group manager as a soft dependency

lost matrix
dull atlas
quaint mantle
eternal night
#

plugin is literally not a field

#

don't blindly copy paste

subtle folio
eternal night
#

Well

#

vault loads at startup

#

so it should find group manager πŸ€”

subtle folio
daring maple
undone axleBOT
eternal night
#

Well, I presume if vault doesn't hook group manager then yea, you are fucked

dull atlas
#

I will try to fix Vault issue and see if anything will change

eternal night
#

does vault hook it without your plugin ?

lost matrix
#

Anvil inventories are not linked to an actual anvil block iirc. What you can try:
Get the inventory holder and check if its a BlockInventoryHolder. But i feel like this wont cut it.

#

Wait where is the anvil question? Did they delete it?

daring maple
#

Seems like it yeah

lost matrix
#

Have i been deceived?

river oracle
#

Gross the UK

mighty pier
#

best way to remove everything from the arraylist?

lost matrix
mighty pier
#

yes

#

thank

#

you

#

found the answer right as you told me it bruh

river oracle
lost matrix
mighty pier
#

every 5 minutes

river oracle
#

Wha wha why πŸ₯Ί

lost matrix
river oracle
limber owl
#

Bump

river oracle
#

It only matters if my code works not how I achieved it to work

lost matrix
#

Ah. What you need is a BlockIterator. Let me show you an example.

river oracle
#

I need to see this too

#

Bless me with your wisdom 7smile7

thin shore
#

I'm working on a plugin that requires me to use player#sendBlockChange() but when I right click the block it disappears. Is there a way to prevent this from happening?

lost matrix
# limber owl Bump
  public List<Block> getBlocksBetween(Location locA, Location locB) {
    Vector direction = locB.toVector().subtract(locA.toVector());
    int distance = (int) Math.floor(direction.length());
    Vector start = locA.toVector();
    double yOffset = 0D;
    BlockIterator iterator = new BlockIterator(locA.getWorld(), start, direction, yOffset, distance);
    List<Block> blocks = new ArrayList<>();
    iterator.forEachRemaining(blocks::add);
    return blocks;
  }
lost matrix
limber owl
subtle oak
#

Hello there. Is there a way to modify server's code without using reflections and custom spigot fork? I used Mixins before, but I can't find a way to use Mixins with spigot

lost matrix
lost matrix
mighty pier
#

is it possible to convert an object into an arraylist whilst keeping it sorted?

eternal night
#

convert an object into an array list ?

#

wat

mighty pier
#

uh

#

uh

eternal night
#

cast it ?

#

you mean ?

mighty pier
#
        Arrays.sort(sortedvalue, new Comparator() {
            public int compare(Object o1, Object o2) {
                return ((Map.Entry<String, Integer>) o2).getValue()
                        .compareTo(((Map.Entry<String, Integer>) o1).getValue());
            }
        });``` i have this
#

tyes

#

how make it arraylist

#

the sortedvaloue

limber owl
lost matrix
wild reef
#

Hello guys, is there an event to check if a trade with a villager was successful - to change the xp you recieve on trade

limber owl
#

Thats what im using, but the perlin noise generator makes spaces between blocks and idk why

limber owl
limber owl
wild reef
lost matrix
# limber owl I have a list of blocks that i m creating a cave from, now i need it to be conne...
  public List<Block> getBlocksBetween(Location locA, Location locB) {
    Vector direction = locB.toVector().subtract(locA.toVector());
    int distance = (int) Math.floor(direction.length());
    Vector start = locA.toVector();
    double yOffset = 0D;
    BlockIterator iterator = new BlockIterator(locA.getWorld(), start, direction, yOffset, distance);
    List<Block> blocks = new ArrayList<>();
    iterator.forEachRemaining(blocks::add);
    return blocks;
  }

  public List<Block> getChain(List<Location> locations) {
    Preconditions.checkArgument(locations.size() > 1);
    List<Block> blocks = new ArrayList<>();

    Location locA;
    Location locB;
    for (int i = 0; i < locations.size() - 1; i++) {
      locA = locations.get(i);
      locB = locations.get(i + 1);
      blocks.addAll(getBlocksBetween(locA, locB));
    }
    return blocks;
  }
#

You could do much better with bΓ©zier curves in a discrete space.
But that a bit of math.

hybrid spoke
#
    private static Location point(float t, Location p0, Location p1, Location p2) {
        
        float a = (1-t)*(1-t);
        float b = 2*(1-t)*t;
        float c = t*t;

        return p0.clone().multiply(a).add(p1.clone().multiply(b)).add(p2.clone().multiply(c));
    }

    private static Location point(float t, Location p0, Location p1, Location p2, Location p3) {
        
        float a = (1-t)*(1-t)*(1-t);
        float b = 3*(1-t)*(1-t)*t;
        float c = 3*(1-t)*t*t;
        float d = t*t*t;

        return p0.clone().multiply(a).add(p1.clone().multiply(b)).add(p2.clone().multiply(c)).add(p3.clone().multiply(d));
    }
    // quadratic Bezier
    public static List<Location> curve(Location p0, Location p1, Location p2) {

        List<Location> points = new ArrayList<>();

        for(float t = 0; t < 1; t+=0.007)
            points.add(point(t, p0, p1, p2));
     
        return points;
    }

    // cubic Bezier
    public static List<Location> curve(Location p0, Location p1, Location p2, Location p3) {
        
        List<Location> points = new ArrayList<>();

        for(float t = 0; t < 1; t+=0.007)
            points.add(point(t, p0, p1, p2, p3));
       
        return points;
    }

just dropping this in

lost matrix
#

But for particles this is surely nice

glass mauve
# wild reef anyone got an idea on this?

I also tried searching it, but couldnt find it.
You could check if the inventory in InventoryCloseEvent is a MerchantInventory,
but that doesnt guarantee you a successful trading.
And I also dont know if the Inventory closes if you trade with a Villager
prob not

hybrid spoke
#

but never continued

#

maybe it helps, maybe it dont

wild reef
glass mauve
hybrid spoke
#

but for a discrete curve a bspline or catmullrom spline would fit better

lost matrix
#

tha fk is a catmullrom spline?

wild reef
glass mauve
#

there is a PlayerExpChangeEvent

#

but there is no REASON Enum or smth

#

so it could be any source

wild reef
#

puh that's hard

glass mauve
#

its different in Paper API

wild reef
#

so I would need to check with interact event, when a trade starts, check via invcloseevent when it's canceled / done and if xp changes, I would need to cancel it then

glass mauve
#

there is a getSource method which returns an entity which can be null

#

there is also a PlayerTradeEvent in Paper

#

but ig you are using Spigot

wild reef
#

I am using spigot in this case :c

glass mauve
#

yea then no idea

icy laurel
#

what does the R in for example v1_16_R3 stand for? I know there's different versions of the nms packages, but I don't know what the R stands for. Release?

kind hatch
icy laurel
#

yep, thanks

hidden kestrel
#

Is it possible, using Scoreboards, to display a string in the player list rather than an integer??

kind hatch
#

Could you be a little more specific? Strings on the scoreboard, or strings in the tablist?

#

Cause both are possible.

#

It's just that, with the scoreboard, you can't remove the numbers on the right side. You can change them, but you can't remove them.

hidden kestrel
#

Yeah I meant the numbers on the right side, if it was possible to use a string instead

#

I wanted to display which world the player was in on the right side, but I suppose that's not possible then

kind hatch
#

Yea, those numbers are used for the ordering of values. They can't be anything other than an integer. Although, it's been that way for a long time now. Not sure if it's for a specific reason though. Mojang makes some weird decisions sometimes.

hidden kestrel
#

I just can't be bothered with using the protocol to make a custom tab list, so I was hoping there was an easier solution lol

#

I guess not

limber owl
subtle folio
#

possible to get the highest block to spawn an entity at a certain x z

#

trying to find the safest spot to spawn an entity at a certain x and z

proven ocean
#

Hey, does anyone know how to fill a falling barrel?
With command it would be something like this:

/summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:barrel"},TileEntityData:{Items:[{Slot:0b,id:"minecraft:bow",Count:1b}]},Time:1}
lost matrix
#

Get the ItemMeta and cast it to PotionMeta. From there you can get the potion effects.

crimson terrace
#

Some people have been getting this error when entering my commands. Anyone know what its about? A quick google search turned up nothing really.

"Out-of-order chat packet received. Did your system time change?"

Appearently they get kicked with this message

lost matrix
crimson terrace
#

the server is on 1.19

lost matrix
#

Do you have any anti cheats?

proven ocean
crimson terrace
#

That is not my server, I just got a report of staff members getting kicked when entering a command.

lost matrix
proven ocean
#

ik, but falling blocks don't have a blockstate

#

and I need TileEntityData not BlockState

#

So i thought that would be the closest one :D

lost matrix
proven ocean
#

That's why I tried casting it to TileEntityBarrel. But I actually don't have an idea what of the falling block I have to cast

proven ocean
#

yessir

lost matrix
#

One moment

crimson terrace
lost matrix
crimson terrace
#

I dont use protocollib, the anti cheat is possible as I dont think ive ever seen that error message...

ornate patio
#

i've spent 4 hours trying to copy the villager ai onto the horse

#

to make it smarter

#

i finally figured it out

#

getAttribute(Attributes.FOLLOW_RANGE).setBaseValue(100); this is literally all i needed to do

small current
#

why when i spawn a falling block like this, it won't show anything until it lands ?

#

it lands fine

proven ocean
#

what I do is updating the TicksLived every tick to 1

#

till it lands

#

idk if that's the best solution tho

lost matrix
#

But why do you want to do this?

small current
#

1.17.1

lost matrix
small current
#

it has to be chest

lost matrix
small current
#

like how other envoy plugins work with chest

proven ocean
#

chest doesnt work

#

idk why

lost matrix
#

Usually they just mount a chest on an ArmorStand and let it descent.

proven ocean
small current
#

stone works

#

should i make an illusion with wood

#

cause might work

lost matrix
proven ocean
lost matrix
small current
#

too lazy to do that

#

figure out when it lands

#

do all the maths and shit with the gravity

#

nah im better with OAK_WOOD

lost matrix
#

Then you need to tag the falling blocks PDC or put it in a Set (or map) so you can replace it in the EntityChangeBlockEvent

small current
#

already done

#

thanks

lost matrix
#

You should never detect custom items by lore or their name.
Always go for data inside the PDC

#

?pdc

lost matrix
#

ItemStacks can hold persistent data

small current
#

is there any event called when a dragon heals using the crystals ?

lost matrix
#

PDC is more modular and safer regarding modifications. (Other plugins might allow the player to change the name or lore of an ItemStack)
Its just overall the cleaner approach.

lost matrix
small current
#

is it only for dragon right ?

#

or like health spells and

lost matrix
iron glade
#

Anyone else getting this?

lost matrix
lost matrix
iron glade
#

nah

#

tried in incognito and it works there

#

even logging in

#

ah now it works again idk what was going on

limber owl
#
BlockIterator iterator = new BlockIterator(locA.getWorld(), start, direction, yOffset, distance);```
vocal cloud
#

You paste it

limber owl
#

?paste

undone axleBOT
limber owl
quartz basalt
#

i want to make a particle force but i need to do data and stuff but i dont wanna add any datat to the particle so how would i do that? its not letting me add null as.getWorld().spawnParticle(part, as.getLocation(), 2, 0, 0, 0, null, null, true); ```spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force)

limber owl
lost matrix
limber owl
quartz basalt
lost matrix
# limber owl and?

This version is ancient and full of bugs. Support was dropped years ago. The community is vanishing.
If you need support for horribly old software then you need to go and dig in old forum posts from half a decade ago.

limber owl
lost matrix
limber owl
#

And just so you know this is happening in populator, so the chunks are only loading when this is happening

lost matrix
limber owl
#

Distance: 1

lost matrix
limber owl
#

Either one and/or both

#

But more vanilla

lost matrix
#

Then let your generator generate vanilla caves.

limber owl
#

I use only populators

lost matrix
#

Otherwise you would need to implement something called "perlin worms"

limber owl
#

I have that, but as it is said, it only creates this

#

I cant attach files

#

But essentially its a spread of block with no connections in between them mostly

#

@lost matrix

eternal oxide
#

are you cancelling the break event and setting AIR yourself?

#

Why are you setting air in BlockBreak if you are not cancelling?

#

Seems a pointless effort

#

then you are in the wrong event

#

That way only cobble is stopped from dropping yet the tool will still be damaged

#

yep

gritty urchin
#

how to get chunks between 2 coordinates

eternal oxide
#

in that case don;t set AIR just getDrops().clear()

gritty urchin
#

@eternal oxide

eternal oxide
#

Math

gritty urchin
#

thx

dawn plover
#

he he, question, if i want to ask questions about a bukit plugin, is here the place to ask them?

eternal oxide
#

If that doesn;t work does BlockBreak have the setDropItems in 1.8?

eternal oxide
dawn plover
#

no no, i am a dev

#

okay, thnx, i dont have question now, but i like to know where to go if something goes horible worng XD

eternal oxide
#

Just set it on fire and walk away

dawn plover
#

i wish XD

eternal oxide
#

Update to a modern version 😦

quaint mantle
#

hello

#

i wanted to do something like when you right click an item and the item is a nether star with name and lore and it says i couldn't pass event PlayerInteractEvent to plugin

crisp steeple
#

code?

quaint mantle
#

?paste

undone axleBOT
lost matrix
#

Im suspecting a nullpointer as usual

quaint mantle
lost matrix
river oracle
#

Npe

lost matrix
quaint mantle
#

i did not

lost matrix
river oracle
#

Also ur code says otherwise too

#

If you right claim a nether star it creates a new recipe

quaint mantle
#

recipe is working

#

but

river oracle
#

Also

lost matrix
quaint mantle
#

where

river oracle
#

Why not register it on enable

quaint mantle
#

dunno

river oracle
#

You register it every time a player clicks the air

lost matrix
quaint mantle
#

aaaaa

#

ok

#

cannot resolve symbol "heart"

crisp steeple
#

that’s a compile error

quaint mantle
trail oriole
#

Does anyone have a good config file tutorial, that includes creation, modification, multiple files, etc...

crisp steeple
quaint mantle
#

then i have to make it public?

crisp steeple
#

no

crisp steeple
#

add a persistent data container to the item with an id of β€œheart” or something

#

then check the items pdc in the oninteract method

quaint mantle
#

bruh

#

i dunno how to do it lol im a beginner

crisp steeple
#

i mean you know how to do recipes

#

kind of the same concept

quaint mantle
#

yes

#

i give up

trail oriole
#

Don't

#

You can't learn if you give up

trail oriole
#

You learn by facing hardships

lost matrix
#

?pdc

novel ether
#

Hello all, looking for a dev for a server I am a part of, more than willing to give a full tour of it πŸ˜„

flint coyote
# quaint mantle i give up

Programming will always lead to problems that you have to solve. And you learn a lot by doing so. Don't give up. It's fun to solve problems

quaint mantle
#

the thing is

#

i dont know where to search

crisp steeple
#

two links right above

quaint mantle
#

and im polish

#

so my english is bad

flint coyote
#

There's always room for improvement :) Or maybe you got a friend that can help you who got more experience

quaint mantle
#

im 11 -__- my friends dont code

mortal hare
#

but still can do programming

quaint mantle
#

and i cant read dosc

mortal hare
#

Programming takes a lot of time

quaint mantle
#

docs *

quaint mantle
mortal hare
#

you should start from youtube tutorials of java

eternal oxide
#

adding a PDC flag to the heart is not the easiest way to do it, but it is the proper way

mortal hare
#

You know whats hard?

#

designing good functioning api is very hard

eternal oxide
#

pretty sure you'd have to add the PDC when its crafted not in its recipe.

mortal hare
#

especially for NMS

eternal oxide
#

It may work in the recipe, I've never tried

vital trout
#

Someone got and idea why "event.getDamager().remove()" doesn't remove instance of Arrow in EntityDamageByEntityEvent ?

mortal hare
#

try getting entity instance inside final variable

#

and executing new task via bukkit scheduler after 1 tick

#
Entity entity = event.getDamager();
new BukkitRunnable() {
  public void run() {
    entity.remove();
  }
}.runTask(this.plugin);

im not sure if this would work but you can try

ornate patio
#

so I'm trying to make a kinda simple algorithm that returns an x, y, and z from a single number but i can't really wrap my head around it, i'll try my best to explain

vital trout
mortal hare
ornate patio
#

not really

#

gimme a moment to type it out

mortal hare
#

Cantor pairing can map two integers into one unique integer, or more integers if steps would be recursively repeated

#

and you can remap those values into two values by reversing the algorithm

#

but it only works for smaller values, since you can easily reach int 32 bit limit

eternal oxide
# quaint mantle https://paste.md-5.net/ijokenosok.cs
ItemMeta heartmeta = heart.getItemMeta();
NameSpacedKey key = new NamespacedKey(this, "hearta");
heartmeta.getPersistentDataContainer().set(key, PersistentDataType.BYTE, (BYTE) 1);
heartmeta.setDisplayName(ChatColor.RED + "" + ChatColor.BOLD + "SERCE");
heartmeta.setLore(List.of("Daj to adminowi jak chcesz dostać dodatkowe serce." + " Nick admina: NG5M"));
heart.setItemMeta(heartmeta);

ShapedRecipe recipe = new ShapedRecipe(key, heart);```
ornate patio
# ornate patio so I'm trying to make a kinda simple algorithm that returns an x, y, and z from ...

I start off with a single block, which is the origin. If i input the number 0, it should return the origin coords, (0, 0, 0)

If i enter the numbers 1-26, it'll go over a list of blocks that surround the origin. For example:
1 -> 1, 0, 0
2 -> 1, 0, -1
3 -> 1, 0 1
4 -> 1, -1, 0
... and so on until all blocks around the origin have been covered

Then, when I reach number 27, it should start searching the next "layer". For example:
27 -> 2, 0, 0
28 -> 2, 0, -1
29 -> 2, 0, -2
.. and so on

I want this to repeat until it searches all blocks within a 20x20x20 cube around the origin

quaint mantle
#

is there a packet for clicking a button in 1.8.9

mortal hare
#

or normal one

quaint mantle
#

like stone button, wooden button

mortal hare
#

maybe interact packet

quaint mantle
#

yeah apparently that's not a thing

eternal oxide
#

yes, because you have to also change the way you detect it in your click event

river oracle
#

And set it as a parameter

ornate patio
mortal hare
#

by getting that fist packet you can raytrace

river oracle
# ornate patio huh

Use a container for 3 numbers x, y and z then in your method take take container apart

quaint mantle
#

What version of spigot is for 1.8 development ?

mortal hare
#

and see if in front of him there is a button

mortal hare
quaint mantle
#

ohhh

#

should i use bukkit =

quaint mantle
quaint mantle
mortal hare
#

Bukkit is an API

quaint mantle
#

hello πŸ‘‹πŸ‘‹

mortal hare
#

You're talking about craftbukkit

#

which is dead too for 1.8

eternal oxide
#
ItemStack item = event.getPlayer().getInventory().getItemInMainHand();
If (!item.hasMeta()) return;
if (item.getPersistentDataContainer().has(new  NamespacedKey(plugin, "hearta"), PersistentDataType.BYTE) {```Or something close.
river oracle
#

1.8 bad

mortal hare
#

Only paid spigot forks support 1.8.8 till this day

quaint mantle
#

Velocity then XD?

mortal hare
#

but they can be unstable

quaint mantle
#

sorry

mortal hare
#

but they're very optimised

#

and support such features as async chunk loading

river oracle
#

1.8.9 isn't a server version

mortal hare
#

which only newer versions of spigot got 1.12+ (basically private devs backported it to 1.8)

quaint mantle
river oracle
river oracle
mortal hare
quaint mantle
#

ty

ornate patio
river oracle
ornate patio
#

bruh lmao

#

im trying to convert a single number into a set of x, y, and z offsets

river oracle
#

Why

#

Would you

ornate patio
#

its for steppable algorithm, each step checks one block around an origin

river oracle
#

Just use an object

#

That stores 3 values

#

Location works

opal juniper
#
System.out.println("nodeIsValid Called");
System.out.println("0");
PathLocation location;
PathBlock block;
try {
    System.out.println("1");
    location = node.getLocation();
    System.out.println("2");
    block = location.getBlock();
} catch (Exception e) {
    System.out.println("3");
    e.printStackTrace();
    return false;
}
System.out.println("Got block: " + block);
System.out.println(block);

Im so confused - i get this output:

nodeIsValid Called
0
1
2
brave sparrow
mortal hare
#

sometimes it does like that

#

that it silently crashes internally

#

i've encountered something like this before too

opal juniper
#

huh yeah it does just silently crash

#

wtf

pearl seal
#

Sorry for the off-topic question. But how do mods in minecraft divide the executable code inside themselves into client and server parts? The mod is both on the server and on the client, and the server part of the mod needs to somehow communicate with the client. For example, I have a mod that adds a new gun. When I issue this gun to myself, some of the functions it uses need to be done on the server side, and some of the functions just can't be done on the server. How is it shared?

brave sparrow
#

The same way the rest of the game does it

#

Packets

pearl seal
# brave sparrow Packets

Is the game involved in all sending packages and other rubbish? Doesn't this happen inside the mod itself?

brave sparrow
#

Packets

cursive sand
#

can you elaborate a little more?

brave sparrow
#

The game has the networking channel for sending data but the mod needs to create and send the packets using that channel

#

@cursive sand if you’re just worried about teleportation you can listen to the teleport event instead of movement

#

Less expensive

quartz basalt
#
    {
        if(pos1.getWorld() != pos2.getWorld())
            return null;
        World world = pos1.getWorld();
        ArrayList<Block> blocks = new ArrayList<>();
        int x1 = pos1.getBlockX();
        int y1 = pos1.getBlockY();
        int z1 = pos1.getBlockZ();

        int x2 = pos2.getBlockX();
        int y2 = pos2.getBlockY();
        int z2 = pos2.getBlockZ();

        int lowestX = Math.min(x1, x2);
        int lowestY = Math.min(y1, y2);
        int lowestZ = Math.min(z1, z2);

        int highestX = lowestX == x1 ? x2 : x1;
        int highestY = lowestX == y1 ? y2 : y1;
        int highestZ = lowestX == z1 ? z2 : z1;

        for(int x = lowestX; x <= highestX; x++)
            for(int y = lowestY; x <= highestY; y++)
                for(int z = lowestZ; x <= highestZ; z++)
                    blocks.add(world.getBlockAt(x, y, z));

        return blocks;
    }``` i put 2 positions but it returns [ ] theres no blocks in the list, why is this happening? they are blocks, there are no void/air blocks
eternal oxide
#

same with Z

quartz basalt
#

thats the same as what i have?

eternal oxide
#

read teh line

brave sparrow
eternal oxide
#

copy/paste error

brave sparrow
#

You have a typo in yours

#

Actually Elgar was pointing out the typo so it is the same as yours

quartz basalt
#

i dont get it

brave sparrow
#

But that’s because he wasn’t giving you fixed code, just explaining the issue

eternal oxide
#

x <= highestY

brave sparrow
#

for(int y = lowestY; x <= highestY; y++)

#

@quartz basalt

quartz basalt
#

ahh

#

ty

brave sparrow
#

Same for your z

short jackal
#

Hey, I want to store data about players (e.g. money and brooms_mounted) and access it & update it (+1, -1, etc) on multiple servers on one BungeeCord network.

We have a dedicated machine and don't often have more than 20 players but I'd like whatever solution to be able to scale up to 100 players without crashing the server.

Is the best route to just query & update the SQL tables every time they're needed? (could be up to like three times a second, per player)

If not, any advice? I know when swapping BungeeCord servers onJoin is called before onQuit, so I want to avoid loading into a map or something then saving on exit.

#

I tried to have a google for Spigot threads addressing this but couldn't find any. Still looking now but if anyone knows of any and could send them over that'd be super helpful too

brave sparrow
#

3 times per second per player for 100 people isn’t that much but you’re still probably better off caching that data

#

Why are you querying it so much per second anyway

ornate patio
short jackal
#

It's more of an absolute-maximum than a likely-going-to-happen thing. For example if they do 3 actions that we want to store stats for in 1 second then we need to update all 3 action's data

brave sparrow
#

Such as?

brave sparrow
#

It seems like you’ve already articulated the specific conditions to apply to the number

#

What is your question?

ornate patio
short jackal
# brave sparrow Such as?

Does an answer to this question change your answer? It's really a worst-case use-case specific to our server

brave sparrow
#

So yes it does

subtle folio
#

I have a yml question here, is it possible to have smt like this that is infinitely expandable?

events:
 - event1:
    - type: pvp
    - reward: money
 - event2: 
     - type: duel
     - reward: points```
brave sparrow
eternal oxide
#

or better make a thread

quaint mantle
#

hello
Δ± write mc puligin how to make console message send message discord channel

brave sparrow
#

@ornate patio you need to start by defining your concept of a β€œlayer”

eternal oxide
#

Is the number you are entering like (1) the layer?

ornate patio
#

x, y, and z offsets from a single number

ornate patio
lime moat
#

Very dumb question, but how would I use an if check to determine if a player has a certain permission?

brave sparrow
lime moat
#

Thank you!

red sedge
#

is there an event that gets called when a villager picks up a job

lime moat
#
',' or ')' expected``` ```java
if (sender.hasPermission(β€œtest”)) {```
short jackal
#

The type of actions you’re storing

lime moat
#

Oh nvm, I'm dumb

buoyant viper
lime moat
#

Last dumb question: java no-permission-message: "<gradient:#FF0000:#FF3DC5>You don't have the "<permission>" to use this command!</gradient>" How could I use ' and " in my config.yml file?

buoyant viper
#

"test"

buoyant viper
buoyant viper
#

usually done with \ character

lime moat
#

no-permission-message: "<gradient:#FF0000:#FF3DC5>You don't have the \"\<permission>\"\ to use this command!</gradient>" like this?

buoyant viper
#

looks like it should work

lime moat
#

Thank you!

dawn plover
#

what is the easyest way to check if a player (or just an entity) is standing on/in a block

#

i tried EntityEnterBlockEvent, turns out that for bees entering there hives :/

red sedge
#

how would i increase the price of villager trades?

opal juniper
#

inflation

red sedge
#

lol

#

i cant find a method like getTrades

opal juniper
#

there is Villager#getRecipes @red sedge

red sedge
#

oh waht-

#

i swear it didnt exist before

opal juniper
#

unmodifiable so you have to get, change, set

spare marsh
#

in PacketPlayOutPlayerInfo what is a b c and d in 1.18.2

mortal hare
echo basalt
#

and see for yourselfd

spare marsh
#

Alright thank you!

mortal hare
#

perfect site for this

#

or you paperweight userdev

#

and remap your jars πŸ˜‰

spare marsh
#

Alright thank you

echo basalt
#

damn that tool is useful

mortal hare
#

ikr

echo basalt
#

I generally just figure it out by myself but it could help me out in the future

mortal hare
#

its useful for reflections

#

at least for me

#

since I remap jars

echo basalt
#

flashbacks to rebuilding and updating a world gen from an obfuscated jar

mortal hare
#

but reflections dont get remapped since you provide method names or field names in a string format

#

ooh fancy

#

NMS accessor autogen

#

you can setup gradle so your spigot plugin can support NMS multiple versions without bothering to implement a system for yourself

quaint mantle
#

hello

#

why not working

mortal hare
#

hi

quaint mantle
#
  @EventHandler
    public void OnBed(PlayerBedEnterEvent event) {
        if(event.getPlayer().isSleeping()) {
            event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,1000, 1));
            event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SATURATION,1000, 1));
        }
    }

kind hatch
#

Did you register your event?

quaint mantle
#

yeah

mortal hare
#

event.getPlayer().isSleeping() could return the player if he is in deep sleep

quaint mantle
#

outher event working

mortal hare
#

when player enter sbed he is not in deep sleep

#

thus

#

your if clause is wrong

kind hatch
#

Wait, what is deep sleep?

quaint mantle
#

yeah

mortal hare
#

when server tries to change time for you

#

i call it deep sleep

echo basalt
#

imma make a PR to add PlayerMimirEvent

quaint mantle
#

what should i change

mortal hare
#

try removing event.getPlayer().isSleeping()

daring maple
#

maybe check for getSleepTicks

red sedge
#

whenever a discount applies to a villager it decreases the price multiplier right?

daring maple
#

and check if that is greather than 0

mortal hare
#

why bother checking sleepticks when an event is fired when he's in bed

spare marsh
quaint mantle
kind hatch
#

When do you want it to happen then?

echo basalt
#

that's... the objectiv

mortal hare
# spare marsh wdym

with paper you can setup a gradle project that way you can use mojang's mappings which allows you to see NMS without obfuscation and reobfuscate your jars for usage in minecraft spigot servers

quaint mantle
#

check x y z ?

mortal hare
#

basically fields like aW b z will be converted to normal source code names, but when you compile your plugin it would revert back

#

to support obfuscated minecraft server software (spigot, sponge)

kind hatch
spare marsh
#

@mortal hare So I create a new paper project with gradle so I can see the mappings?

mortal hare
#

you need setup paperweight-userdev gradle plugin

#

google it

#

you'll find out how

fossil nebula
#

hey is there any way to cancel swimming? I tried cancelling the EntityToggleSwimEvent event, and setting LivingEntity.setSwimming to false, but neither seems to have any effect.

spare marsh
#

alright

fossil nebula
#

(pretty new to plugin development, so I have no idea if I'm even going about this in a sane way)

buoyant viper
#

set player to not sprinting

#

maybe

kind hatch
#

I don't think there is an easy way to do it without NMS. The client will still play the swimming animation in several cases.

buoyant viper
#

im honestly pretty certain just stop sprint would work ngl

fossil nebula
#

I'll give it a try, thanks

buoyant viper
#

do u just reply to people at random

fossil nebula
fossil nebula
quartz basalt
#

if i add a passenger to an armor stand i cant move it anymore, is there a way around this?

kind hatch
#

Wdym by move?

quartz basalt
#

teleport

#

ive tried https://www.spigotmc.org/threads/teleport-entity-with-passenger.223261/ but [23:05:30 WARN]: java.lang.IllegalArgumentException [23:05:30 WARN]: at jdk.internal.reflect.GeneratedMethodAccessor21.invoke(Unknown Source) [23:05:30 WARN]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) private static final Method[] methods = ((Supplier<Method[]>) () -> { try { Method getHandle = Class.forName(Bukkit.getServer().getClass().getPackage().getName() + ".entity.CraftEntity").getDeclaredMethod("getHandle"); return new Method[] { getHandle, getHandle.getReturnType().getDeclaredMethod("b", double.class, double.class, double.class, float.class, float.class) }; } catch (Exception ex) { return null; } }).get();

buoyant viper
golden turret
#

a

kind hatch
golden turret
buoyant viper
#

reflection on top

#

πŸ’ͺ

mortal hare
#

whats wrong with reflections sometimes it is needed

#

and you have no way to access for example protected field or method

echo basalt
#

I'm still waiting for the day where someone makes a hardware-optimized minecraft server OS

#

sounds like a fun project ngl

mortal hare
#

thats not gonna happen

dire marsh
#

sounds cursed

echo basalt
#

saw a guy make a tetris OS, how hard would it be to impl the minecraft protocol

dire marsh
#

have fun with chunks

mortal hare
#

there's open source project called glowstone which is alternative to NMS server software

#

it supports 1.12.2

#

at max

kind hatch
mortal hare
#

its not as if the community cant build new server software its just that the community cant keep up with mojang's roadmaps and maintain totally different server software by replicating mojang's gameplay functionality in their own software. Cat and mouse game. Its the same for spigot and paper, but its way easier to modify existing codebase rather than implementing the codebase yourself

echo basalt
brave sparrow
mortal hare
#

i saw that dude creating that tetris OS too

#

what native minecraft server codebase currently lacks is concurrency

#

but its very hard to achieve that

#

especially with current minecraft's server architecture

buoyant viper
#

iirc theres work to do this with the client going on rn

#

an OS dedicated to just running the game

mortal hare
#

its possible to make optimized version of JVM just for minecraft

#

but it would be the same as writing new server software, in which case it would make no sense, because whenever minecraft update rolls out, you'll need to update it

sweet pike
#

how can I design my EntityTargetLivingEntityEvent to disable Mobs being able to target players, specifically through barrier blocks?

#

im okay with setting up my event, but idk how to actually design the barrier bit

fallen steeple
#

What is the best library to manage inventories and is it useful to use one if you have always used the default inventory system?

mortal hare
#

In my opinion what should spigot/paper should do is to add an option to decouple api methods and optimizations from server software

#

that way you can make hardcoded modifications to server software without having api overheads

brave sparrow
#

What?

mortal hare
#

add an option to build tools

#

to build a jar without bukkit api in it

#

and without its NMS traces

#

completely removing bukkit api with its hooks inside NMS

#

with only optimizations and patches left out

#

and maybe plugin support

#

but without any api methods or fields

brave sparrow
#

So you want build tools to just build the minecraft server jar from mojang?

mortal hare
#

no

#

I want buildtools to build a JAR which has all the paper's optimization patches but without bukkit api support

brave sparrow
#

Why

fallen steeple
#

thx it look good

brave sparrow
#

Also build tools has nothing to do with paper

mortal hare
# brave sparrow Why

there's no reason for public use, but for private use, you're removing the overhead of api hooks inside NMS

#

thus a bit improving performance

brave sparrow
#

They’re not going to just release an optimized vanilla jar lol

mortal hare
#

for example there's a bunch of api hooks inside ServerGamePacketListener class which could be removed

cursive loom
#

Hey ! I need your help for a plugin, I don't know how I can get an item when I click him on another item in a inventory, thx for advance

mortal hare
#

about 500+ lines of code could be removed

#

just from this class alone

brave sparrow
#

That’s not what spigot is

mortal hare
#

knowing well that NMS is mostly single threaded it would benefit CPU usage

brave sparrow
#

The purpose of spigot is the plugin API, not to release an optimized version of vanilla

mortal hare
#

why not give an option to remove the api inside build tools

brave sparrow
#

If you want to do that you can fork it and do it yourself

mortal hare
#

if they can inject patches into NMS they can sort those patches into front end and back end patches as well

brave sparrow
#

Because that would require work on something that isn’t what they want to do

#

They aren’t trying to make an optimized vanilla jar

mortal hare
#

I bet hypixel does something like this

brave sparrow
#

Hypixel uses the plugin API lmao

mortal hare
#

they have some kind of stripped out version of spigot fork

brave sparrow
#

They use the bukkit/spigot api for their stuff

#

For the most part

#

The api hooks are not meaningfully impacting performance

mortal hare
#

well packet handling is handled in main thread

#

most of api hooks are there

brave sparrow
#

And it’s not the bottleneck you think it is

mortal hare
#

?paste

undone axleBOT
mortal hare
#

for example this is the hook for inventoryclickevent

cursive loom
#

Hey ! I need your help for a plugin, I don't know how I can get an item when I click him on another item in a inventory, thx for advance

mortal hare
#

look how much is being done just to support that event

#

none of this is being used in NMS internally

brave sparrow
mortal hare
#

each container has clicked method

brave sparrow
#

You’re talking about microseconds

#

That’s not the issue with Minecraft’s performance by any means

#

Lmao

kind hatch
cursive loom
mortal hare
#

can someone explain me the purpose of Optional<>?

#

cant you just use IF statement?

#

it get it in C/C++ where you cant return null values

#

but in Java?

#

huh??

fickle helm
#

imo @Nullable and @NotNull are better served than using Optional

spare marsh
#

With Bukkit Teams, do you have to be part of the team to see the prefix or you can see their prefix without being part of the team?

#

Anybody know this?

eternal oxide
#

you have to be on teh same scoreboard

spare marsh
#

If they are on the same scoreboard but different team

#

Let's say for each player there is a different team

#

I'll see their team's prefix

eternal oxide
#

depends on the Team.OptionStatus for that Option

spare marsh
#

if its on always

eternal oxide
#

then everyone can see it

spare marsh
#

Aight thanks that was my question

iron glade
#

I was planning on adding a "controll [player]" command to my troll plugin, would it be a good way to

  1. cancel the victims movement event
  2. make the controlling player invisible
  3. teleport the victim to the controller every tick
    ?
    I was also thinking about some additional events like cancelling the victims chat event and replacing the controller's name with the victim's name when he is typing
    Are there any other events I should take care of?
#

maybe when the controller executes a command execute it as the victim? could be useful for /msg or /whisper stuff

buoyant viper
lost wolf
#

Hi, is there a way to modify the villager trades a player sees without changing the villager's original MerchantRecipes?

river oracle
#

No

#

Actually wait

#

You can add recipes

#

But you'd have to change the original merchant recipe list for thag

lost wolf
#

Yeah, you can add and remove MechantRecipes to a villager's list. But I'd like to modify the recipes of the list and allow the player to trade with those modified recipes without permanently modifying the original MechantRecipes.

river oracle
#

No you can't change them

#

Just remove it and read the same recipe

lost wolf
#

Maybe I could store the original MechantRecipes as PersistentData in the villager

river oracle
#

Confused why you would want to do this

lost wolf
#

I was thinking of allowing emerald prices to be higher than 64 emeralds by swapping for emerald blocks whenever the prices go over 64

kind hatch
#

Ugghh, I'm trying to figure out how to make this file system work with what I want it to be able to do. This is my resources folder. Some of these files are critical to the plugin's functionality. Namely config.yml, defaults.yml, overrides.yml and at least one of the locale files.

Right now, I have all of these files being created with a mess of code.
Most of the files are created with this FileManager class: https://paste.md-5.net/uyeduwovos.java
All of the language files are created with this bit of code in the main class: https://paste.md-5.net/emesabizet.cs

The problem I'm having is trying to balance how I should manage them all. My current idea is to have each individual system have control over their respective files, but I'm worried that would lead to a bunch of repeating code. (E.G. The language files would be handled by a LangaugeManager class. The mysql files would be handled by the MySQLDataManager, etc)

The other problem with this is figuring out how to get consistent verbose output. I want to be able to see if anything went wrong at startup in an easy to read format. If it's not done in a certain order, the output could be broken up between other parts of code that run first.

I've been trying to hack something together, but I'm just stuck right now. What should I do about this?

river oracle
# kind hatch Ugghh, I'm trying to figure out how to make this file system work with what I wa...

File systems can be a massive hassle. I actually have my own configuration utility called ConfigUtils all you need to do is pass in a plugin instance and file path super easy to use this could help you with repetitive file code you could extend this or take a look at the code and see what you want. I use this for all of my configs. While I'm sure this isn't the best util out there it really helps me make stackable configs which I'm using in my upcoming gui plugin
https://github.com/Reecepbcups/ServerTools-MC/blob/main/src/main/java/sh/reece/tools/ConfigUtils.java

GitHub

100+ Modular commands & methods replacing many critical plugins in 1 - ServerTools-MC/ConfigUtils.java at main Β· Reecepbcups/ServerTools-MC

#

Credit to reece here for making it and sharing with me I love it and couldn't imagine using anything else

iron glade
#

new SimpleDateFormat("MMMM-dd-yyyy_HH:mm:ss-a"); what kind of format is this lol

buoyant viper
#

im gonna need a few text samples from that file

kind hatch
river oracle
#

I'd love to mock up you some code with the util I use but I can't as I'm on my phone

#

But it should make your life less hell

kind hatch
#

I was going to just loop through #getKeys(true) and run the strings through the #owoify method, but if you've got a better solution, I'm down.

river oracle
#

That method seems fine to me. But the code your shared seems like a mess

#

I'd create languagemanager object

kind hatch
#

Oh, it's definitely a mess. I'm fully aware of that fact. xD

kind hatch
#

That section in configs called version and there is a comment above it saying to never change it. Usually at the top.

river oracle
#

Hold up

#

That's an edited version of mind

kind hatch
river oracle
ivory sleet
#

Because well… literally everything in Java can be null

#

sure @smoky tinsel and @urban grotto can fix it… but they don’t enforce it

#

Woops

river oracle
#

That's there fault lmao

ivory sleet
#

Optional shows your intention of absence of a value more clearly

kind hatch
# river oracle Ofcourse you do ahahha

Yea, the problem is that things are a mess right now. It's kinda screwing me up. What I want is for all of the files to be created at startup, then double check to see if they are there when reloading the plugin. The language files are actually a separate system right now, but I have that one bit of code in the FileManager that creates an english language file on startup.

lime moat
#

?paste

undone axleBOT
river oracle
lime moat
#

How could I fix this?

kind hatch
#

Wait, why didn't I think of this?

river oracle
#

This is the only config util I use

ivory sleet
kind hatch
#

I was wondering about that. I know that spigot caches the main config by default. Was thinking if it would be problematic to call that frequently or not.

ivory sleet
#

Yes

ivory sleet
#

Many poor plugins use that factory method relentlessly

kind hatch
#

Does YamlConfiguration#loadConfiguration() also cache the file? Or does it just do what you'd expect?

ivory sleet
#

No

#

It’s just sugar for using new YamlConfiguration(), followed by load()

#

and automatic error handling

river oracle
#

Don't spam call getConfigFile I only use it once on enable

ivory sleet
#

and load makes an io call whenever called

kind hatch
#

Gotcha. My current implementation is right then. I create an object, load it, then pass it around to where I need it. I'd like to keep it that way. πŸ˜„

lime moat
#

player.setWalkSpeed(0.2f); what's the max value I can use here?

kind hatch
#

I think speed maxes out at 1F.

lime moat
#

Perfect, thank you!

#

How could I do something like if (args[0] >= 10)?

#

Basically I need to see if args[0] is greater than or equal to 10

kind hatch
#

Convert it to an integer and then compare it.

#

Integer#parseInt()

lime moat
#

Hmm, how would I store it into a variable? Integer.parseInt(args[0]); (I'm very new to java, sorry)

quaint mantle
#

?learnjava

undone axleBOT
lime moat
#

Heh, I'll do those

river oracle
#

How make variable lol

lime moat
#

I know a few variables, but I've never used more than about 3 xd

quaint mantle
#

yeah ive used a few variables in my day

river oracle
#

Variables are pretty nice

lime moat
#

One more thing, how could I do something like player.setWalkSpeed(speedf); As I believe I need the f there for this to work the way I need it to.

#

speed is a variable (int)

kind hatch
#

Either cast it, or in this case, just make your speed variable a float.

lime moat
#

Could you elaborate float a bit, please?

kind hatch
#

float speed = 0.2F;

lost matrix
lost matrix
kind hatch
#

fixed.

lime moat
#

Erm

#

I'm still super confused on how I would use that.

kind hatch
#
int myInt = 18;
double myDouble = 0.2;
float myFloat = 0.5F;
long myLong = 8_301_275_578L;
short myShort = 255;
byte myByte = 2;
char myChar = 94;

Just some examples of the different types of variables you can use.

buoyant viper
#

now give me byte short and char

#

smh

lost matrix
vocal cloud
#

3.3333333333333335 enjoyer

lime moat
#
                        Integer speed = integer / 10;
                        float f = speed;
                        double d = f;
                        player.setWalkSpeed(f);``` Like this?
#

or am I horribly mistaken?

lost matrix
#

?learnjava

undone axleBOT
lost wolf
#

Is PersistentData kept after a transformation?

quaint mantle
#

wym

kind hatch
lost wolf
#

Anything that might call the EntityTransformEvent

buoyant viper
#

wouldnt be very persistent if it wasnt persistent now would it

kind hatch
lost wolf
lost wolf
kind hatch
#

Unless you are changing persistent data on said item, then it should be preserved. Not sure about entity transformations though.

#

You'd probably want to test that.

lost matrix
clear fable
#

Hi I'm experiencing some really odd behavior with inventory events. I'm using paper api, but I dont think its an issue with paper. For all InventoryClickEvents and all InventoryDragEvents in the player inventory the inventory type is always CRAFTING which is not the expected behavior as per the docs https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/inventory/InventoryType.html

The documentation says that any interactions within the 4x4 crafting grid and result slot should be CRAFTING and any interactions within the 36 player inventory slots as well as offhand and armor should be type PLAYER. This is my code:

@EventHandler
public void onPlayerInventoryClick(final InventoryClickEvent e) {
    e.getWhoClicked().sendMessage("Click: " + e.getInventory().getType());
}

@EventHandler
public void onPlayerInventoryDrag(final InventoryDragEvent e) {
    e.getWhoClicked().sendMessage("Drag: " + e.getInventory().getType());
}

And in game I get this output where ever I click

#

Help would be appreciated

kind hatch
#

Which part of the inventory are you clicking on?

clear fable
#

I tried every slot in the player inventory

#

all hotbar slots, upper inventory, offhand, armor, and crafting grid

#

I get CRAFTING for every slot no matter what

kind hatch
#

InventoryClickEvent#getView#getBottomInventory()

clear fable
#

ah ok weird

#

does getInventory return the top inventory by default which is the crafting grid?

kind hatch
#

I think it returns the top inventory by default.

#

But even then I'm not sure.

#

I've had weird experiences with it too.

clear fable
#

thats really unintuitive if thats how that works

kind hatch
#

Well it had something to due with how inventories changed in a certain version.

#

It used to be simple.

clear fable
#

oh i see

kind hatch
#

Now it's split up.

#

The "inventory" that you expect is now an InventoryView.

#

It contains both the top and bottom parts of the inventory.

clear fable
#

OHH

#

i see

#

so the base Inventory class contains both the top and bottom views

#

and each view has its own type

kind hatch
#

Yea. As for how it derives the type, I have no clue. It could get it from the top inventory, but don't quote me on that.

clear fable
#

the weirdest part is that you cant get the views from just the Inventory object

#

so idk how tf it actually works behind the scenes but it looks like a huge mess

#

:mojank:

quaint mantle
#

Is there any server dedicated to making plugins?

quaint mantle
#

I cant find anyone that actually has motivation

kind hatch
#

It was annoying learning how to get the proper inventory with that update. It also moved the #getTitle method to the view as well.

quaint mantle
clear fable
clear fable
quaint mantle
kind hatch
#

?services

undone axleBOT
quaint mantle
#

And who wont ghost me for a month after it is 99% done

willow widget
#

anyone knows what's the event triggered by a item frame being broken or losin what it is framing?

kind hatch
vocal cloud
#

I still think a requests channel should exist lol. So many messages about requests recently kek

ornate patio
stoic vigil
#

i've got an vector object as string (out of an location object, it's the direction). how to cast this back into a location? i cant get this as Vector object, only as string

#

it's a string such as this: -0.0,1.0,6.123233995736766E-17 and i want to set the direction of an locationobject with this data

dim palm
#

Maybe integer#parseInt?

#

i never worked with vector so idk

quiet ice
#

That would be Double#parseDouble If anything

#

String#split and Double#parseDouble I guess

torn oyster
#

whats the best way to create minigame servers

#

i'm thinking a prefab system

quiet ice
#

Having 100 Minestom instances

thorny dawn
stoic vigil
quiet ice
#

If it comes via a command I'd replaced the commas with whitespace

#

That would avoid a String#split call and be more intuitive

stoic vigil
#

jap, that seems nice, but idk if i can do this... i've got to split the string anyways. thy

subtle folio
#

is this kind of yaml possible? ```yml
events:

  • eventOne:
    • ID: 1
    • description: "Event One"
    • action: "kill"
    • type: "ZOMBIE"
    • amount: 100
    • reward: "money"
    • rewardAmount: 100
    • rewardTopOne: "money"
    • rewardTopOneAmount: 100
    • rewardTopTwo: "money"
    • rewardTopTwoAmount: 100
    • rewardTopThree: "money"
    • rewardTopThreeAmount: 100```
quiet ice
#

Yeah

#

Though These are lists

#

So beware that some funny stuff might happen

subtle folio
#

i was just trying to visualise

#

yea

fossil eagle
#

Hey, tried making my first plugin today, but I'm getting a couple problems when I try and run it on my test server. For starters I get the following problem...Legacy plugin FirstPlugin v1.16.5 does not specify an api-version.

golden kelp
#

you need to add this in your plugin.yml

#
api-version: 1.16
fossil eagle
#

Ok thanks, also the 'version' in the plugin.yml is referring to a minecraft version or something else?

#

Or is it just kind of version bookkeeping just for my understanding.

earnest forum
#

plugin version

#

ur plugin version

#

its not the mc version

fossil eagle
#

Ok and assuming it's my plugin it would just be 1 then lol

earnest forum
#

yes

#

its a string

fossil eagle
#

Sweet thanks

earnest forum
#

u can represent it in any way

fossil eagle
#

Ayy first plugin works

lime moat
#

How could I make that work? Right now, anything lower than 10 just freezes you.

agile anvil
#

Since your speed is lower than 10, speed / 10 = 0

#

Just do a float division : speed / 10.0 ;)

#

So that it will give something between 0 and 1

earnest forum
#

walkspeed is from 0.0 to 1.0

#

example 7 / 10 = 0.7

lime moat
#

float walkspeed = (speed / 10.0);

float
Provided:
double```
earnest forum
#

add an f to 10.0

#

10.0f

lime moat
#

Ah, thank you!

dim palm
#

why when i use a command on my plugin the tps goes from 20.00 to 19.40

lime moat
#

Default speed is 0.2f, correct?

earnest forum
#

yes

lime moat
#

Perfect, thanks!

quiet ice
torn oyster
#

whats the best way to create minigame servers
i'm thinking a prefab system

quiet ice
#

Depends really

dim palm
unkempt peak
dim palm
#

but when nobody's online the tps lags a lot

quiet ice
quiet ice
torn oyster
#

for players who wanna play

#

or well - just servers in general

quiet ice
torn oyster
#

i'm programming it

ivory sleet
eternal oxide
#

lagging when no one is online would seem to indicate a serious issue with code running that shouldn't

agile anvil
earnest forum
#

read what i said mate

#

anything below 10 divided by 10 is a decimal

#

its not 0

ashen quest
hybrid spoke
#

or contribute to cool stuff

ashen quest
#

Yea

buoyant viper
#

never gonna give you up

ashen quest
#

same

hybrid spoke
ashen quest
#

I need a list of spigot projects

harsh totem
ashen quest
#

i want to contribute to open source and use spigot to start off

buoyant viper
ashen quest
#

hmm

#

not like that

#

some Spigot APIs

#

which make stuff easier for other devs

hybrid spoke
buoyant viper
hybrid spoke
#

have fun making a chunk cache so we can access unloaded chunk snapshots

ashen quest
#

hehe i m doin the 69th problem in my assignment right now

hybrid spoke
#

otherwise contribute to my overwatch idea

ashen quest
#

send link πŸ”«

hybrid spoke
#

which does not exist yet

ashen quest
#

oh

#

i had an idea

#

i make a script that downloads every spigot plugin using resource ids

buoyant viper
#

csgo overwatch... hypixel atlas...

ashen quest
#

and then malware check them?

buoyant viper
hybrid spoke
#

but im too lazy to make it

#

at least not motivated enough to make it alone

ashen quest
#

but he didnt check all plugins

#

better tree api maybe

hybrid spoke
#

have fun wasting your time on this

#

it will take time and even afterwards you have to check them manually

ashen quest
#

why?

hybrid spoke
#

your script will not find everything

ashen quest
#

well ill use that antimalware plugin thing

buoyant viper
#

oh u know what i did see from paper that make be a nice duplicate plugin number 2948282?

#

world size

#

how much disk space a world takes up

ashen quest
#

i should make a plugin that would delete it self

#

and then delete the server

#

and slowly takeover the world

#

😌

buoyant viper
ashen quest
#

πŸ˜‰

#

worth it

#

jk

flint coyote
#

what if he states in the description that it does exactly what he just said?πŸ€”

#

In that case it's a feature and not a malicious intention

hybrid spoke
buoyant viper
#

include minecraft in your plugin

#

so the server admin can play mc while the servers running

ashen quest
ashen quest
#

maybe render minecraft using ascii in server terminal

ebon topaz
#

how would i go about making a plugin to stop endermen teleporting onto bottom slabs

daring maple
#

Check for EntityTeleportEvent and cancel if entity is enderman and block is bottom slab

grim ice
#

what was that cuboid class in spigot called?

#

OH RIGHT BOUNDINGBOX

tacit dagger
#

is there any way to add spaces between "accept and deny" ?

vocal cloud
#

Make a text component space?

loud junco
#

or just add a space after accept

#

but that will make it clickable

#

so yeah, space component

tacit dagger
tacit dagger
loud junco
#

make a text component without any click action

#

that is only a space