#help-development

1 messages · Page 1681 of 1

eternal oxide
#

yes use onCommand in replace of your execute

stark marlin
#

Might just put the tab executor in the main class then I guess

eternal oxide
#

its just a method name change

#

same args

#

then in yoru main register the Command Executor

lost matrix
#

Do you know what a Set is?

crimson terrace
#

how do I get something akin to a hashmap that allows duplicate keys?

eternal oxide
#

You can;t have duplicate keys

#

unless its a List

halcyon mica
#

@lost matrix Removing craftmob from the spigot entity did not change it, neither did removing bukkit mob from the interface

kindred valley
crimson terrace
#

so I need an actual list for duplicate keys?

eternal oxide
#

duplicate entries

#

the whole point of a keySet is that a single key references one value

#

if you want to store multiple objects under that key you can

#

but you use one key

crimson terrace
#

meh, might just use the Location as a key and the uuid as a value

#

works all the same, just cant read it as well from the file

eternal oxide
#

what are you trying to do?

crimson terrace
#

Im making a plugin so you can lock chests and they cant blow up. im trying to limit the amount of chests a player can lock

eternal oxide
#

use Block not location for a start

crimson terrace
#

fair

eternal oxide
#

then store as Map<UUID, Set<Block>>

crimson terrace
#

didnt think of that, thanks 😄

lost matrix
crimson terrace
#

might just use a list as the second one

halcyon mica
#

Which one

#

lmao

eternal oxide
#

List you can mess up as it allows duplicates, Set doesn;t

#

however, Blocks are unique, so

crimson terrace
#

I trust my code not to mess up so it wouldnt add duplicate blocks

lost matrix
dense goblet
#

have a block position class and override its hash and equals methods

#

then use that in a set

halcyon mica
#

I implemented it everywhere

#

No change

dense goblet
#

if you make it immutable then you get a small performance boost too in some situations afaik

crimson terrace
#

im not trynna make it complicated

quaint mantle
#

For curiosity, is there a neat event that detects when cobblestone is generated from flowing lava and water?

young knoll
#

Yes

crimson terrace
#

i think its bugged tho

dense goblet
dense goblet
#

just use a set its guaranteed not to mess up

crimson terrace
#

😄

#

aight

dense goblet
#

unless you wanna play program correctness with java code which is not fun

crimson terrace
#

thanks for the ideas guys, ill get to codin more with this 😄

austere cove
#

yo why is terracotta not Directional?

lost matrix
lost matrix
dense goblet
young knoll
#

Normal terracotta?

lost matrix
#

I think they are aligned by axis and not ordinal direction

austere cove
#

wait I didn't say anything shh

young knoll
#

Glazed Terracotta is directional :p

dense goblet
austere cove
#

bukkit api implements it just fine, it's the mc wiki that isn't updated

#

smh my head

quiet ice
#

which wiki?

austere cove
#

regular fandom

quiet ice
#

ah

quaint mantle
#

hello i'm asking about how to add tags for players like this
https://prnt.sc/1rbriss
i tried player.setCustomName("[Tag]");
but no works

#

if i used scoreboard teams they will give the same tag for all players on team

lost matrix
lost matrix
halcyon mica
#

I just copied the plugin extension from the blog post for 1.17

#

Didn't mess with it

dense goblet
lost matrix
# halcyon mica I do, yes

Try not to. This means your plugin would only run with a moj mapped jar for once but the error could be in there
as Pose might be resolved weirdly

halcyon mica
#

Hm

#

In that case I do not reobfuscate it

lost matrix
#

Just to rule it out

halcyon mica
#

Because it works with a bog-standard spigot jar

lost matrix
#

I mean if you dont re-obfuscate it. Then it will only run with a mapped jar.

halcyon mica
#

right

lost matrix
#

Try removing the remap goal and see if it compiles without it

halcyon mica
#

Nope

#

No change

#

What wonders me is why the error is apperantly caught in the interface

#

Not the spigot entity or the nms one

#

But it just points to the beginning of the file

#

Ok, I have narrowed it down

#

When I stub the Interface, it works

lost matrix
#

Like a mock impl

halcyon mica
#

Yes, the pathfinder interface

#

And by stub, I mean comment out the entire body of the interface

#

Do note, the mob extension remains

lost matrix
#

Did your Pathfinder import nms Pose?

halcyon mica
#

Nope

#

Infact, the only nms stuff stuff it imports is PathNavigation and Path

#

Which is unrelated to poses

lost matrix
#

Did you try commenting out methods?

gusty briar
#

does anyone that knows citizensapi know why this error is happening?

[19:16:03 ERROR]: Could not pass event PlayerInteractEntityEvent to Dirtlands v1.0
java.lang.IllegalStateException: no implementation set
    at net.citizensnpcs.api.CitizensAPI.getImplementation(CitizensAPI.java:70) ~[Dirtlands.jar:?]
    at net.citizensnpcs.api.CitizensAPI.getNPCRegistry(CitizensAPI.java:103) ~[Dirtlands.jar:?]
    at net.dirtlands.listeners.shopkeepers.Shopkeeper.playerInteractWithEntity(Shopkeeper.java:27) ~[Dirtlands.jar:?]
    ...

the error happens here:

 if (!CitizensAPI.getNPCRegistry().isNPC(e.getRightClicked()))

I heard that it's because citizens needs to fully load first, but i have it as a dependency in my plugin.yml ([WorldGuard, LuckPerms, ProtocolLib, Citizens]) and i even put a scheduler around the line that i register the event (which apparently waits until the first tick of the server to run)

halcyon mica
#

AHA

#

So it is the spawn method

#
    static Pathfinder spawn(Location loc) {
        return new CraftPathfinder(
                ((CraftWorld) loc.getWorld()).addEntity(
                        new PathfinderMob(((CraftWorld)loc.getWorld()).getHandle()),
                        CreatureSpawnEvent.SpawnReason.CUSTOM,
                        (e) -> e.teleport(loc),
                        false));
    }```
lost matrix
gusty briar
lost matrix
atomic gyro
#

hey there yall. Having a bit of an issue trying to use getResourceAsStream() to read files in the minecraft.jar. Any tips?

#

The JavaDoc is less than helpful, maybe I'm reading it wrong.

vast sapphire
#

?paste

undone axleBOT
lost matrix
atomic gyro
#

I'm trying to get the JSON files readable as Strings, almost like this;

#

Specifically the loot tables.

lost matrix
atomic gyro
#

I'm going to use the Strings to create a simplified version of the loot table in an inventory so the player can view them without having to read the JSON file.

gusty briar
atomic gyro
#

?

#

I'm just having trouble using getResourceAsString(), I don't seem to understand what I'm supposed to set to else?

gusty briar
# lost matrix First: Citizens is utter garbage. Then call ``CitizensAPI.getNPCRegistry()`` in ...

oh nevermind it happened again

[20:20:47 ERROR]: Error occurred while enabling Dirtlands v1.0 (Is it up to date?)
java.lang.IllegalStateException: no implementation set
    at net.citizensnpcs.api.CitizensAPI.getImplementation(CitizensAPI.java:70) ~[Dirtlands.jar:?]
    at net.citizensnpcs.api.CitizensAPI.getNPCRegistry(CitizensAPI.java:103) ~[Dirtlands.jar:?]
    at net.dirtlands.Main.onEnable(Main.java:32) ~[Dirtlands.jar:?]
CitizensAPI.getNPCRegistry();
lost matrix
# atomic gyro I'm just having trouble using getResourceAsString(), I don't seem to understand ...

Simplest way would be to just save them to disk and read them from there.
But here is a simple approach to getting the String from a json stream.

  private final Gson gson = new GsonBuilder().disableHtmlEscaping().create();

  public String toJson(final InputStream inputStream) {
    try (final InputStreamReader reader = new InputStreamReader(inputStream)) {
      final JsonObject jsonObject = this.gson.fromJson(reader, JsonObject.class);
      return jsonObject.toString();
    } catch (final IOException e) {
      e.printStackTrace();
      return null;
    }
  }
atomic gyro
#

How would I be getting the information as a Stream? Do I call it using the NamespacedKey?

lost matrix
#
  @Override
  public void onEnable() {
    InputStream isr = this.getResource("theFile.json");
  }
#

Just make sure to not let the stream hanging

atomic gyro
#

This is my first time really using streams, so I have no idea what that means.

lost matrix
#

Use it right away.

atomic gyro
#

Ah ok, it'll be getting used moments after the call. Thanks for the heads up.

#

Is there a means of using the NamespacedKey functions to get the file name as a .json file? So far I've been able to get minecraft:entities/mobname but I don't know what I'd do from there.

lost matrix
#

Wait. You want to get those json files from your own jar, right?

gusty briar
atomic gyro
lost matrix
atomic gyro
lost matrix
#

Any reason why you dont want to use the loot table API from spigot?

atomic gyro
#

The loot table API doesn't seem to have any means of accessing the weight, min/max, or special lore about the items.

eternal oxide
#

The API will not allow you to list items and weights

atomic gyro
#

Loot Table API seems to just be for filling chests.

kind coral
#

rectangle or circle would be great thanks! Im using your workload system, its amazing

#

both of them would make the game better so yeah

lost matrix
# kind coral rectangle or circle would be great thanks! Im using your workload system, its am...

A square is quite easy.

  public List<Block> getSquare(final Block middle, final int radius) {
    final List<Block> blockList = new ArrayList<>();

    for (int x = -radius; x <= radius; x++) {
      for (int z = -radius; z <= radius; z++) {
        final Block relativeBlock = middle.getRelative(x, 0, z);
        blockList.add(relativeBlock);
      }
    }

    return blockList;
  }

A rectangle would be

  public List<Block> getRectangle(final Block middle, final int xWidth, final int zWidth) {
    final List<Block> blockList = new ArrayList<>();

    for (int x = -xWidth; x <= xWidth; x++) {
      for (int z = -zWidth; z <= zWidth; z++) {
        final Block relativeBlock = middle.getRelative(x, 0, z);
        blockList.add(relativeBlock);
      }
    }

    return blockList;
  }
kind coral
#

could we go in dm's so you could help me on actually implementing this?

lost matrix
kind coral
#

i have a method on the server start that saves all the locations of each block of the terrain

#

won't this lag players?

severe oracle
#

how do i connect to sqlite database ?

lost matrix
kind coral
kind coral
#

xd

#

biggest server in italy so yeah the map is very big

lost matrix
#

Oh

kind coral
#

i know but the map is very big

lost matrix
#

You could make it so only one block per tick falls 😄

kind coral
#

that would also make a smooth effect ⭐

native gale
#

How do I find every mob tamed by player X?

lost matrix
#

I mean you could do it for every mob even in unloaded chunks but
thats quite the task

lost matrix
kind coral
kind coral
sacred ice
#

Hello, there is a way to hide all optifine and mojangs capes? it is possible?

tribal crane
#

Q: (I know nothing when it comes to plugins) is it possible for a plugin to modify the contents of another plugins folder?

ivory sleet
#

yah it is

quiet ice
#

well, not always, but in most cases, yes

paper viper
#

but why

#

why do you want to do that

#

just wondering

tribal crane
#

We have a plugin, advanced Chests, it doesn't have a native repair function for stuff like swords as we mainly use it for auto selling so a repair to sell gold swords would be great and I did mention it to the dev but they seemed a bit iffy about it

tribal crane
solar breach
tribal crane
#

It's a development question thus I posted it here, where should have I?

chrome beacon
#

This is the right place ignore him

quiet ice
#

it is mostly the correct channel

ivory sleet
#

Yeah idk if this guy is also yet another alt from those recently banned people

tribal crane
#

Oh okay I was going to say if I am worng I will gladly move

ivory sleet
#

No need 👍

tribal crane
#

Anywho I'll look more into it when I get home as I'm at work, at least ac dose provide some sort of API so I may be able to use that

ivory sleet
#

yeah

#

presumably you'd use Plugin#getDataFolder

left swift
#

when i want use Long2IntLinkedOpenHashMap i have error in console [23:17:54 FATAL]: Failed to schedule load callback for chunk [0, 0] java.util.concurrent.CompletionException: java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/libs/it/unimi/dsi/fastutil/longs/Long2IntLinkedOpenHashMap how can i fix that?

ivory sleet
#

What version is the server running on, and what version do you compile against?

dusty sphinx
#

Is there a way to teleport someone without effecting their momentum? Like can I just move somebody up 0.3 blocks and have their motion remain the same

left swift
ivory sleet
#

Yeah

#

Might be the case it got removed

left swift
#

ok, i check this

ivory sleet
#

Like the normal teleport method

dusty sphinx
#

Actually i think I might've said the wrong thing

#

It keeps momentum

#

But like if a player is pressing W, they only start moving in the air which obviously means they don't have the same momentum

ivory sleet
#

What about getting their velocity before and applying it after the teleport?

dusty sphinx
#

Doesn't make a difference

#

Like if someone is pressed up against a wall holding foward and they get teleported i want them to move foward

#

So is there a way to check if a player is holding foward?

ivory sleet
#

Don’t think

left swift
ivory sleet
#

Cuz it’s basically client sided

#

?paste

undone axleBOT
dusty sphinx
#

i was about to say, what do you need a paste for, are you on mobile? then i checked your status

dusty sphinx
#

still kinda stupid how discord doesn't embed stuff right on mobile

ivory sleet
#

Yeah

dusty sphinx
#

that and how fucked up conversations are on android are just textbook examples of how little discord cares about mobile

ivory sleet
#

lmao yeah

#

Their development progress certainly isn’t the most effective one imo

ancient plank
#

// You're mean.

left swift
# ivory sleet What did u change btw?
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.17.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>``` and from java version 1.8 to 16
#

and api ver in plugin yml

ivory sleet
#

And ur server version?

left swift
#

1.17.1

#

paper

ivory sleet
#

What if u add the paper api as a dep instead

#

Maybe paper yeeted those classes

dusty sphinx
#

paper doesn't delete classes

#

at most they would mark it as depreciated

ivory sleet
#

Idk

#

Probably

#

Might just b a relocation

eternal night
#

^^ probably just a missing relocation on papers end

dusty sphinx
#

likely

#

report the issue on papers end

left swift
#

thx for help!

dusty sphinx
#

i can't see how that changed anything

dusty sphinx
#

that classic paper jank

left swift
#

and plugins using paper api won't work on spigot, right?

eternal night
#

^ they might not

#

well you might be lucky and just don't use paper api methods xD

dusty sphinx
#

paper api is pretty good it's just weird in execution

#

it might break off from spigot eventually

sweet sun
#

Hello I have a issue with bungee cord

dusty sphinx
#

i think breaking compatibility with spigot plugins is a good price to pay for efficiency and not having weird work arounds

sweet sun
dusty sphinx
#

go on

#

its a final class

sweet sun
#

How can I fix this? Is there a other way to fix it?

dusty sphinx
#

you cant extend a final class

sweet sun
#

But why did it work in the source code of them?

dusty sphinx
#

?

sweet sun
#

Is there an other way to fix this?

#

Because I need it

dusty sphinx
#

what are you trying to do

sweet sun
#

I copied this class because the vid said paste this in it

dusty sphinx
#

well following a video is your first issue what does the class aim to do

#

ComponentBuilder is final for a reason

#

?

sweet sun
#

Why is it final?

#

Because in his code it worked perfectly

#

I’m coding in 1.12 and he’s coding in 1.8 or lower Idn

eternal oxide
#

You answered your own question

ancient plank
#

java go brrr

dusty sphinx
#

following tutorials where you just copy line for line isn't exactly the best idea

#

what are you trying to do

#

i can advise you a better way to do it

#

or at least try

alpine urchin
#

?ask @zinc plover

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. Create a thread in case the help channel you are using is already in use!

zinc plover
#

i have a problem to read out of my config if a special value already exists

#

can somewone help me with this and show me how i can do that

quaint mantle
#

?

eternal oxide
#

getConfig().isSet(path)

native gale
zinc plover
quaint mantle
#

getConfig().isSet(path)

zinc plover
quaint mantle
#

.equals

zinc plover
#

ah ok

quaint mantle
#

wait what?

zinc plover
#

thanks bro

quaint mantle
#

getConfig().isSet(path) returns a boolean

zinc plover
#

ah ok so i must integrate what i am searching in the path

eternal oxide
#

you asked how to test if a value exists

zinc plover
#

yes

quaint mantle
#

he told you

eternal oxide
#

isSet will tell you if there is a value in your config under that path

#

you then get to see what the value is

zinc plover
eternal oxide
#

I just told you how

digital plinth
#

erm is there a way to run a specific method with a specific interval

ivory sleet
#

?scheduling

undone axleBOT
digital plinth
#

and the interval's duration depends on a condition

paper viper
#

?scheduling

undone axleBOT
paper viper
#

lol

digital plinth
quaint mantle
#

yes you can

#

if (condition)

paper viper
#

lol

ivory sleet
#

^

digital plinth
paper viper
#

use an AtomicBoolean

#

or smthing

#

AtomicInteger

quaint mantle
ivory sleet
#

MutableLong maybe

digital plinth
#

oh okay

#

thx

paper viper
#

AtomicMutableMemorySpringLongImpl

ivory sleet
quaint mantle
#

nice name

zinc plover
#

thanks guys it worked

zinc plover
#

can i add players to the config like this

#

1:

#

-Viereckig

#

-Elena

eternal oxide
#

use UUID not name

quaint mantle
#

player.getUniqueId()

zinc plover
eternal oxide
#

a List

zinc plover
#

arraylist?

paper viper
#

sure

patent horizon
#

is there a way to compactly register/unregister listeners without hardcoding objects

zinc plover
#

is that normal that it saves UUIDs in the config like this

#

!!java.util.UUID 'b305ad03-35bb-421f-8d93-52cbe30bb88c'

unreal quartz
#

if you save the object directly then yes

#

but that will not load

#

there is no registered deserializer for uuid by default i believe so you should save as string instead

zinc plover
#

ok

#

thanks

quaint mantle
olive valve
#

does anyone know why this wont work? ```if (event.getDamager() instanceof Player) {
Player damager = (Player) event.getDamager();
if (damager.getInventory().getItemInMainHand().getEnchantments().containsKey(Enchantment.getByKey(VenomousRegister.VENOMOUS.getKey()))) {
Mob victim = (Mob) event.getEntity();
victim.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 5, 1, true, false, false));

        }
    }
}``` it doesnt add **poison** to the _victim/mob_
tacit drift
#

setCustomName it's their Nickname

olive valve
#

can someone help me??

tame fern
#

(getBlock().getBlockData() instanceof Leaves)

This should work right?

tame fern
#

Can't seem to get it work. I'm setting the persistence right that after and the leaves still decay.

olive valve
#

idk then

eternal oxide
#

Tag.LEAVES.isTagged(block.getType())

olive valve
#

does anyone know why this wont work? ```if (event.getDamager() instanceof Player) {
Player damager = (Player) event.getDamager();
if (damager.getInventory().getItemInMainHand().getEnchantments().containsKey(Enchantment.getByKey(VenomousRegister.VENOMOUS.getKey()))) {
Mob victim = (Mob) event.getEntity();
victim.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 5, 1, true, false, false));

        }
    }
}``` it doesnt add **poison** to the _victim/mob_
vague oracle
#

debug code it

tame fern
#

Oh shoot. Got to set the BlockData after. I'm dumb.

olive valve
vague oracle
#

Yes code to show where it goes wrong

olive valve
vague oracle
#

Yes, so after every if statement, print a message to console to see if its being run

olive valve
#

so like send a message every statement??

tame fern
#

That's also gonna throw a NPE if you attack without an item in your main hand.

olive valve
#

what is an NPE?

vague oracle
#

I also don't see an instance check for Mob

#

a Null Pointer Exception

olive valve
#

is it like an error message?

vague oracle
#

Yes it will send an error message to console if you are not holding anything

olive valve
#

how do i prevent that??

vague oracle
#

Also, how do you know how to code what I assume to be custom enchants but don't know what a NPE is?

olive valve
#

i have no idea why i didnt know what an NPE was

#

also i did debug the code and it does send the message

vague oracle
#

so you put a print line after the addpotioneffect line?

vague oracle
#

I mean you are giving it for 5 ticks or 1/4 a second

#

that is probably your problem

olive valve
olive valve
vague oracle
#

Well can I see it?

olive valve
vague oracle
#

Sure

patent horizon
#

is it possible to make one inventory (gui) to open to multiple people instead of make 1 per person

quaint mantle
#
Bukkit.getPlayer(uuid).openInventory(inv);
// ...
#

do you mean synchronized?

patent horizon
#

yeah but in the tutorial i saw, they did like Bukkit.createInventory(args) with a player as the first argument

quaint mantle
#

no thats for blocks and stuff

#

inventoryholders to be exact

#

the first arg for creating a custom inventory should be null

torn vale
quaint mantle
#

dont keep a list of players

#

it should be List<UUID>

#

also

#
List<T> myList = new ListImplementation<>();

in this case

List<UUID> flyingPlayers = new ArrayList<>();
#

Hey can any1 help me please? Im trying to create a random class chooser. Im trying to create a minecraft manhunt minigame and am trying to create a randomizer on who is the speedrunner and make everyone else the hunter.

lavish hemlock
#

You can use Java's Random class to return a random integer between 0 and 1, and then iterate through each player, if Random returns 1, then you make that player the speedrunner and everyone else the hunter.

solemn gulch
#

there are better ways more efficient

get a list of all the players select a random user from the list using javas random class assign that player to be the speedrunner and then everyone else can be hunters

lavish hemlock
#

in that case

#

You can generate between 0 and the last index of the List (players.size - 1 I think?), then just players.get(myRandomInt)

quaint mantle
#

ok

unreal quartz
#

the upper bound is exclusive

lavish hemlock
#

aight

#

I can never remember

unreal quartz
#

you want the size not the last index otherwise some poor player won’t ever get to be the runner lol

lavish hemlock
#

reminds me of my Murderer chances on Murder Mystery tho lmao

quaint mantle
#

Slight problem tho

#

Ive never created a plugin before

solemn gulch
#

i would start off with something simpler than hunter vs speedrunner if its ur first time
just try making fun commands and some event listeners that do wacky things so you can get a grip of how to make them

#

then once you are ready apply all the knowledge to create an event like hunter vs speedrunner

lavish hemlock
solemn gulch
#

it deff is one of the easier ones but if u havent done anything before its probably best not to do any gamemodes as a first plugin

lavish hemlock
#

I guess that's fair

solemn gulch
#

i mean it depends how you learn really

#

but you shouldnt expect us to spoonfeed you all the answers

#

or code anything for you

quaint mantle
#

So any tips becuase Ive never worked with java before. I have used lua tho

lavish hemlock
quaint mantle
#

A bit

lavish hemlock
#

That's a good start. I don't have much advice to give in-general, but if you need help with something specific you can go ahead and ping/message me.

unkempt peak
# quaint mantle A bit

I would reccomend following some guides or tutorials for spigot before you start making your own plugins

quaint mantle
#

Ok

unkempt peak
quaint mantle
#

Ok I will deffinetly search them up

#

Thanks

quaint mantle
#

Yes, but no

#

Huh

#

just follow the tutorials

#

ok

crude charm
#

but dont learn spigot

#

?learnjava

undone axleBOT
crude charm
#

learn java first

#

then go in

#

will save you alot of bullying

quaint mantle
#

Ok

proud basin
#

ZoiBox doesn’t know anything so we bully him everytime

stark marlin
#

If I have added a command by altering the command map directly by code, is it still possible to set a tab completer for the command? I tried to do it by getCommand().setTabCompleter() but that just caused NPE

woeful crescent
#

Hey guys. I've been trying to make an ability that involves shooting out an item from the player as if they had dropped it, but multiplying its velocity to increase its speed. However, no matter what approach I take to the situation, the item almost always seems like it's shooting out from the center of the player...
Here's a video of the item launching aspect in action:

#

Here's the code used to drop the item (in its current state):JAVA Item droppedItem = player.getWorld().dropItem(player.getLocation(), item); Location eyeLoc = player.getEyeLocation(); droppedItem.setVelocity(eyeLoc.getDirection().normalize().multiply(0.7));

#

OHHH

#

whoops

#

lmao

#

should move the eyeLoc line up so I can use it in the spawn line as well though

hasty prawn
#

Yes

round python
#

so so far I made it so you could mount dolphins underwater and that my custom dolphins replace regular ones

#

but

#

slight problem

#

how do I make the player control it

woeful crescent
#

set the dolphin's direction to the player's direction?

#

Maybe?

#

try it

#

could be an easy fix

#

You would also have to set the dolphin's yaw and pitch to the player's yaw and pitch

round python
#

how would I do that?

woeful crescent
#

You would utilize the Location#setDirection and Location#getDirection methods in order to get and set directions

#

For yaw and pitch, you would want to use Location#getYaw and Location#getPitch

round python
#

ohh ok tysm

woeful crescent
#

I know yaw and pitch might sound complicated if you don't know what it is yet, but it's really just two rotational factors

#

Sorry, but I need to leave now, so if that quick solution doesn't succeed, you'll have to work out another one on your own.

round python
#

yeah its like the yaw and pitch of a plane right

#

also yeah np

#

ty for your help

woeful crescent
#

Pretty sure it's the two rotational axis

#

Cya

round python
#

so might dolphin replacing thing is quite janky so how would I make it so that dolphins are replaced with my dolphin

#

im using entityspawnevent

brisk lotus
#

who helps me create a server with all the plugins for Prision OP? please

quaint mantle
brisk lotus
#

ok

lunar thunder
#

What's the best way to "enable" features based on the server version? Like, what I'm doing involves blocks. So I want to have this so it could check for a minimum server version and go from there for each set of blocks, with each set being the new blocks added in a major version

sharp bough
#

if you answer, could you dm it to me, im about to go to bed, thx

candid galleon
#

you could probably set the X/Y coordinates in OBS

lavish hemlock
neon nymph
#

SQLite statement

ALTER TABLE players RENAME TO old_players

apparently returns a query?

PreparedStatement ps = c.prepareStatement("ALTER TABLE players RENAME TO old_players");
ps.executeUpdate();

[12:26:51 WARN]: java.sql.SQLException: Query returns results

#

But for the MySQL connection it is fine, it doesn't error. Is the fault on my end or on the jdbc itself?

dusk flicker
#

prob cant have the table named table

neon nymph
#

Oh that's just a sample. I have it named something else completely

dusk flicker
#

try PreparedStatement#execute()

#

rather then executeUpdate

neon nymph
#

Tried that, still the same thing

#

Currently have the workaround if (m.version.equalsIgnoreCase("sqlite")) ps.executeQuery(); else ps.executeUpdate();, it works, but I'm not confident about it, plus it looks ugly

dusk flicker
#

odd

#

syntax looks fine, you don't need the TO there but not sure if that would do shit

neon nymph
#

Yea you need the TO I think, if you wanna rename table name itself

dusk flicker
#

you don't

#

oh then you need it

#

yes

#

only verified can

compact cape
#

Does anybody know why NMS that was working on all versions is not no longer working on 1.17?

#

Any quick fix? I noticed some of classes moved...

eternal oxide
sterile dome
#

im trying to make a server chat bot any idea how to make it?

hybrid spoke
sterile dome
#

minecraft for discord

chrome beacon
#

The easiest way is just to use a java wrapper for the discord api and hook that

sterile dome
#

im also trying to use git bash but whenever i put the command from the spigot downloading it says please do not run this path with special characters

solid cargo
#

probably basic problem, but, 'else' without 'if'

#

tell me if u need all code

chrome beacon
#

Just use if

#

Why is there a need for else

sterile dome
#

olivo

#

so

#

any fix?

chrome beacon
sterile dome
#

i tried

#

no characters

#

no special

chrome beacon
#

Send path

sterile dome
#

where dop i send it

#

dms or here

chrome beacon
#

Either

solid cargo
#

?paste

undone axleBOT
solid cargo
#

also some internal problems but i can fix those myself

sterile dome
#

@chrome beacon dms

manic furnace
#

How can i run my plugin in a new Thread?

ivory sleet
#

new Thread(() -> {
//TODO
}).start();

manic furnace
#

How can i start a schedular in a new thread?

opal juniper
#

Bukkit.getScheduler()

#

and then pass it a lamba or a bukkit runnable

near night
#

does any know why my command don’t work? ```@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (command.getName().equalsIgnoreCase("redeem")) {
if (sender instanceof Player) {
Player p = (Player) sender;
p.sendMessage(ChatColor.AQUA + "test 2");
}
}

    return true;
}```
#

it dose nothing

#

plugin.yml ```name: codes
version: '${project.version}'
main: net.picklestring.codes
api-version: 1.17
authors: [ Pickle ]
description: Codes!
website: picklestring.net
commands:
redeem:
description: Redeem a code
usage: /<command>

hybrid spoke
#

"register" - set the executor

near night
hybrid spoke
#

is there an error in your console?

tidal skiff
#

how do i check if an advancement is, well, an advancement, instead of a recipe?

hybrid spoke
near night
near night
#

what function do i do it in?

#

onstartup?

#

onEnable i mean

zinc plover
#

yes

near night
#

ok

zinc plover
#

you must register your command class in the onenable

near night
#

thx

zinc plover
#

and also in the plugin.yml

near night
tidal skiff
#

How to check if advancement isn't recipe?

zinc plover
#

you go in the main class to the onenable methode

near night
#

ok tysm

zinc plover
#

getCommand("command").setExecutor(new ClassnameofCommand());

zinc plover
near night
#

tyssm

tidal skiff
#

How to check if advancement isn't recipe?

#

How to check if advancement isn't recipe?

near night
#

still didn’t work 😦

upper osprey
#

How to make armorstanf mount displayname and rorate ?

quaint mantle
#

just a question for this

#

do you have to set one first

#

or is it whatever order

maiden briar
#

How do you write a list in a yaml config?

key:
- "Like this?"

key2:
  - "Or like this?"
regal dew
#

both are allowed

#

I like second more though

#

add 180

#

well, it doesnt really make much sense for 2 vectors which cross each other to have an angle more than 180

#

well, if u want 270, add 180 xd

#

angle just gives the angle between the two vectors, if u have to rotate 270 degrees then u add 180 kek

lean gull
#

does anyone know how to set the damage delay for a player to a millsecond and how to set the attack delay (like the crit delay) to a millesecond too?

opal juniper
#

What is the best way to stop explosion damage with tnt?

#

I spawned the TNT so i have access to the Entity Object but i didnt really see a method under TNTPrimed

quaint mantle
#

ive tried saving bed parts manually and then resetting them but i cant get it to work as both beds and up being bottom parts. does anyone know how to do this properly?

maiden briar
solid cargo
#

anyone has an updated way of having a cooldown for commands?

hybrid spoke
solid cargo
#

ok thanks

regal dew
#

Well, what are you trying to achieve

sullen ember
#

can anybody tell a plugin through which blocks drop random item

chrome beacon
sullen ember
#

ok

compact cape
#

Stupid question, But what will be the reason an iron golem target zombies or skeletons?

lost matrix
compact cape
lost matrix
lost matrix
compact cape
#

I want the zombie act like a tamed animal

hybrid spoke
#

so just cancel the EntityTargetEvent and use #setTarget(Entity) if the player is attacking another animal

maiden briar
#

What is the default value of Attribute.GENERIC_ATTACK_DAMAGE for a Wolf ?

compact cape
maiden briar
#

Ok for normal then

lost matrix
#

I think 4

compact cape
maiden briar
#

I did, but if I set it to 0.2 they will one-shot any player

compact cape
lost matrix
hybrid spoke
maiden briar
#

setBaseValue on AttributeInstance

compact cape
maiden briar
#

I did

#

0.2 was printed

chrome pewter
#

public class Custom_cat extends EntityCat {

public Custom_cat(EntityTypes<? extends EntityCat> entitytypes, World world, Location loc) {
    super(entitytypes, world);
    this.setPosition(loc.getX(),loc.getY(),loc.getZ());
    this.setCustomName(new ChatComponentText(ChatColor.GOLD + "MEOW"));
    this.setCustomNameVisible(true);
    this.setHealth(1000);
}
#

i been working on a custom mob, is there a way which i can change the ai to a baby zombie

lost matrix
#
  1. Naming conventions. CustomCat
  2. Dont clutter your constructor with all those arguments.
public class CustomCat extends EntityCat {

  public CustomCat(final Location location) {
    super(EntityTypes.j, ((CraftWorld) location.getWorld()).getHandle());
    this.setPosition(location.getX(), location.getY(), location.getZ());
    this.setCustomName(new ChatComponentText(ChatColor.GOLD + "MEOW"));
    this.setCustomNameVisible(true);
    this.setHealth(1000);
  }

}

@chrome pewter

manic furnace
#

Can sime one give me a example code for run a bukket runnable in a new thread?

lost matrix
manic furnace
#

The second

lost matrix
# manic furnace The second

Here are 4 examples

    JavaPlugin plugin = ...;
    Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
      // Do some stuff
    });
    JavaPlugin plugin = ...
    Bukkit.getScheduler().runTaskAsynchronously(plugin, this::someAction);

  }

  private void someAction() {
    // Do some stuff
  }
    JavaPlugin plugin = ...
    new BukkitRunnable() {

      @Override
      public void run() {
        // Do some Stuff
      }
      
    }.runTaskAsynchronously(plugin);
public class CoolTask extends BukkitRunnable {

  public CoolTask() {
    // Add stuff
  }

  @Override
  public void run() {
    // Run something
  }

}
------------------------------------------------------
    JavaPlugin plugin = ...
    new CoolTask().runTaskAsynchronously(plugin);
steady rapids
#

anyone knows if is it possible to remove this speed limit? when I sprint & jump on a pressure plate (launchpads plugin) I get too fast and i get a teleport bug in game and this warning in the console:
[13:26:09 WARN]: Excessive velocity set detected: tried to set velocity of entity #260541 to (0.21773703415135898,1.8,-4.427639896930246)

lost matrix
#

And even then you shouldnt

maiden briar
#

AttributeModifier.Operation I don't understand what those do, who can explain?

steady rapids
manic furnace
lost matrix
maiden briar
#

Thanks for the explanation!

quasi flint
#

That ist a nee thread

#

new

#

is

lost matrix
chrome pewter
#

for example a cat

lost matrix
chrome pewter
#

i am using nms

lost matrix
chrome pewter
#

do you think my answer will be in pathfinder

compact cape
#

Another stupid question, What event manages Entities despawning??

hushed pasture
#

hello

#

i have an error soo i was wondering if someone could help i am making a plugin

lost matrix
# chrome pewter thank you

To be honest. Its probably better to just use LibsDisguises and spawn a zombie that is displayed as a cat...

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. Create a thread in case the help channel you are using is already in use!

compact cape
hushed pasture
#

ok

#

Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "com.redberry.sweet.Sweet.getCommand(String)" is null
at com.redberry.sweet.Sweet.onEnable(Sweet.java:14) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:492) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:406) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:554) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:257) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:928) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at java.lang.Thread.run(Thread.java:831) [?:?]

#

my pplugin.yml

lost matrix
hushed pasture
#

name: Sweet
version: 1.0
author: Redberry
main: com.redberry.sweet.Sweet
api-version: 1.16
givewand:
description: Gives creeper wand to play.
usage: /<givecreeperwand>

#

this is the plugin.yml

lost matrix
#

Sweet line 14 pls

hushed pasture
compact cape
#
name: Sweet
version: 1.0
author: Redberry
main: com.redberry.sweet.Sweet
api-version: 1.16
commands:
  givewand:
    description: Gives creeper wand to play.
    usage: /<givecreeperwand>
quartz pike
lost matrix
hushed pasture
#

getCommand("givecreeperwand").setExecutor(new SweetCommand());

lost matrix
compact cape
lost matrix
hushed pasture
compact cape
#

The names do not match

quartz pike
#

it has to be the exact names..

hushed pasture
#

ohh

#

ok ok

compact cape
#

They must match

lost matrix
# hushed pasture ok ok
commands:
  givewand:
    description: Gives creeper wand to play.
    usage: /<givewand>

Dont forget the commands sections

hushed pasture
#

and on my line 14 i have the ("givecreeperwand") soo do i change it to ("givewand")

compact cape
#

Hmm, I have a map of creatures to some data, How can I remove data when the creature despawns??? Is there any event??

lost matrix
hushed pasture
#

ok

lost matrix
hushed pasture
#

/<givewand> this is what i should put on my plugin.yml right

lost matrix
compact cape
hushed pasture
compact cape
hushed pasture
#

oh soo on usage could i do /<givewand creeper>

chrome pewter
#

Did they remove goalSlector in nms

lost matrix
hushed pasture
#

ok thanks

lost matrix
hushed pasture
#

ok

#

still getting an error

#

Error occurred while enabling Sweet v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "com.redberry.sweet.Sweet.getCommand(String)" is null
at com.redberry.sweet.Sweet.onEnable(Sweet.java:14) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:492) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:406) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:554) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:257) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:928) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[spigot.jar:3096-Spigot-9fb885e-296df56]

lost matrix
chrome pewter
lost matrix
hushed pasture
#

if its getting to crowded then if u want i could show u in dm

lost matrix
hushed pasture
#

just a sec

#

my line 14: getCommand("givewand").setExecutor(new SweetCommand());

#

my plugin.yml: name: Sweet
version: 1.0
author: Redberry
main: com.redberry.sweet.Sweet
api-version: 1.16
givewand:
description: Gives creeper wand to play.
usage: /<givewand>

hushed pasture
#

what

#

ok i got it

#

can i add change /givewand to /givewand creeper

#

just reply with yes or no

lost matrix
hushed pasture
#

ok

#

this line : if (cmd.getName().equalsIgnoreCase("givewand")) {

#

this is in my SweetCommands

#

class

upper osprey
#

How to rorate armorstand head follow yaw pitch body player?
P/s: while mounting displayname

lost matrix
# hushed pasture this line : if (cmd.getName().equalsIgnoreCase("givewand")) {

Here is an example:

public class SweetCommand implements CommandExecutor {

  @Override
  public boolean onCommand(final CommandSender commandSender, final Command command, final String label, final String[] args) {
    final int argumentCount = args.length;

    if (argumentCount != 1) {
      commandSender.sendMessage(ChatColor.RED + "You need to specify one argument.");
      return true;
    }

    String firstArg = args[0];

    if (firstArg.equals("creeper")) {
      // Give creeper wand
    }

    return true;
  }
  
}

if (cmd.getName().equalsIgnoreCase("givewand")) { <- This does nothing unless you use the same CommandExecutor for multiple commands.

hushed pasture
#

thanks u fixed the error

lost matrix
# upper osprey Plss help me 😦
    ArmorStand armorStand = ...
    Player player = ...

    Location delta = player.getEyeLocation().subtract(armorStand.getEyeLocation());
    double tanBearing = Math.atan2(delta.getZ(), delta.getX());
    armorStand.setHeadPose(new EulerAngle(0, 180 - tanBearing, 0));

This should at least cover the yaw. Ill let you figure out the pitch yourself.

upper osprey
chrome pewter
#

did they remove this.targetslector in NMS

#

in 1.17.1

opal juniper
#

it’s probably just obfuscated

#

look for the return type

knotty ruin
#

Yeah I’d use the mojang mappings in the dev env to speed stuff up

#

You can get gradle or maven to map back to normal

quaint mantle
#

Can someone help me please. I get this error when trying to run eclipse:

tacit drift
#

Says right there

#

also, use intellij

#

easier to use and looks better overall

quaint mantle
quaint mantle
tacit drift
#

Search Java 11

#

lol

quaint mantle
#

I have java 16 downloaded

hybrid spoke
prisma needle
#

Is it possible somehow to mute certain messages from sending in the console? In particular I don't want to see these messages in the console....
[15:21:27] Disconnecting com.mojang.authlib.GameProfile@00000000[id=00000000-0000-0000-0000-000000000000,name=<NAME>,properties={textures=[com.mojang.authlib.properties.Property@00000000]},legacy=false] (/000.0.0.0:00000): You are not whitelisted on this server!

gleaming grove
#

Does it make sense to assign null to all objects of my plugin in onDisablePlugin event in order to invoke garbage collector?

ivory sleet
#

Nope it doesn’t

#

The objects will most likely be enqueued for gc regardless

ivory sleet
#

Well if another plugin is hard referencing let’s say, your CachedUserManager, then it might not get gcd and instead a leak might be the case

gleaming grove
#

ok, that make sense

ivory sleet
#

Tho I don’t know whether something like paper might reflectively unset and resolve that, in which case it would be safe more or less.

#

Anyways you should let other plugins depend on an api of yours to gain control over this.

quaint mantle
#

the garbage collector will get it all

#

if its still running?

ivory sleet
#

Necessarily not

paper viper
#

^

ivory sleet
#

If we assume another running plugin is still hard referencing something in the disabled plugin, that instance cannot be garbage collected.

prisma needle
paper viper
#

its a 13kb jar

quaint mantle
#

look at the code

paper viper
#

just decompile it

quaint mantle
#

all it does is catch sysouts

paper viper
#

the github isnt available

quaint mantle
#

?

paper viper
#

they didnt make it open source

quaint mantle
#

menace

prisma needle
quaint mantle
#

open it with intellij

paper viper
#

Just saying, there is no point of hiding console messages really

#

idk why you would want to avoid the spam

ivory sleet
#

Unless it gets spammed with command block execution logs lol

prisma needle
#

it's not really about hiding them, more about replacing them with a more readable messages

paper viper
#

what..

prisma needle
paper viper
#

You lose debug information such as whether they are authenticated or not, their IP Address if they were IP Banned the first place, their UUID

#

its not worth it

prisma needle
#

I mean I could add all that info into the message if I wanted...

#

Worth it or not, it would be nice to know how to do it :)

manic furnace
#

Can i run a event in a new thread?

lost matrix
manic furnace
#

How can i do that?

lost matrix
manic furnace
#

I start a scheduler when a player joins and write hist positions to a txt file every 30 seconds

quaint mantle
#

i wonder would it would be like if spigot were multi threaded

opal juniper
#

a bit like paper, just even better

manic furnace
lost matrix
quaint mantle
#

NMS | Spigot

#

Bukkit.getNmsThread

manic furnace
lavish hemlock
quaint mantle
#

?scheduling

undone axleBOT
lost matrix
manic furnace
#

I meaned a listener

lost matrix
#

@manic furnace This is the simplest approach.
Just get all players online async every N seconds and write their position to a file.

Bukkit.getOnlinePlayers() should be thread safe.

manic furnace
#

I have a moved how to do that.

#

But how can i listen to a event and execute the listener in a new thread?

lost matrix
manic furnace
#

I tried that but when i out print the thread it is the server thread

lost matrix
# manic furnace I tried that but when i out print the thread it is the server thread

This is how you start a new async task per player when he joins.
When the player leaves you need to stop the task again.
TrackerTask has to be your own Runnable implementation.

public class PlayerLocationLogListener implements Listener {

  private final JavaPlugin plugin;
  private final Map<Player, BukkitTask> playerBukkitTaskMap = new HashMap<>();

  public PlayerLocationLogListener(final JavaPlugin plugin) {
    this.plugin = plugin;
  }

  @EventHandler
  public void onJoin(final PlayerJoinEvent event) {
    final Player player = event.getPlayer();
    final TrackerTask trackerTask = new TrackerTask(player);
    final BukkitTask bukkitTask = Bukkit.getScheduler().runTaskTimerAsynchronously(this.plugin, trackerTask, 0, 600);
    this.playerBukkitTaskMap.put(player, bukkitTask);
  }

  @EventHandler
  public void onQuit(final PlayerQuitEvent event) {
    final Player player = event.getPlayer();
    final BukkitTask bukkitTask = this.playerBukkitTaskMap.remove(player);
    bukkitTask.cancel();
  }

}
golden turret
#

i would do a global task

quaint mantle
#

🥄

golden turret
#

with a simple object or map to store the last storage

lost matrix
golden turret
#

why

#

😔

lost matrix
#

Idk

#

I think he hasnt done much with tasks so far. Which is totally ok.

stone sinew
#

task per player is probs safer anyways. That way if he gets to many players the tasks are spread out

lost matrix
#

They are async anyways.

#

So wouldnt matter.

quaint mantle
#

How do i make a paper-spigot plugin in 1.8.8?

golden turret
#

use spigot as base

#

hope i helped 👍

lost matrix
golden turret
#

let they use 1.8

lost matrix
quaint mantle
golden turret
lost matrix
golden turret
#

you can run both client and server with only 512mb of ram

lost matrix
#

I want the API to not be forced to support versions that are older than the people using it.

quaint mantle
#

But then how would i make my server run on 1.8? if i cant use 1.8 to code?

eternal night
quaint mantle
#

ye but i kinda also want the 1.8 pvp and all the plugins that exist for that are very buggy

eternal night
#

allows you to run the latest server software but people from older versions may still connect

eternal night
#

they are?

golden turret
lost matrix
golden turret
#

there is a lot of threads about that

quaint mantle
#

thats not a plugin link :D

lost matrix
# quaint mantle Do u have any?

Anyways. If you really want to code with old buggy software:
You need to add the spigot API as a dependency to your project.
Do you use maven?

quaint mantle
#

yes

#

But its fine ill use viabackwards !

lost matrix
#

Then try running BuildTools with the 1.8.8 as target to install it into your local maven repo.

vague oracle
#

It makes no sense why people prefer 1.8 pvp, 1.17 pvp is perfectly fine if you know how to do it, but 1.8 pvpers dont so they stick to 1.8. IMO there is more of a skill gap with 1.17 pvp.

atomic gyro
#

i like 1.8 pvp because its just better

vague oracle
#

How?

lost matrix
vague oracle
#

its perspective

atomic gyro
#

1.17 pvp has cooldowns so you cant do any of the cool stuff you could do before, like combos/strafe hit

vague oracle
atomic gyro
#

while i like 1.17 pvp, it lost all the cool parts and became a hit n run fest with axe crits and shields

#

theyre both good, in different ways

#

1.8 for fast paced skill heavy combat and 1.17 for slow paced tactile combat

vague oracle
#

I do myself not like shields, but what you can do is lower the damage for all weapons, remove shields and remove the hit cooldown. This edited version of 1.17 pvp is very fun.

#

no 1.8 is not skill heavy

vague oracle
#

its who can click faster

atomic gyro
#

no its definitely not

vague oracle
#

it is you click faster you hit them first

atomic gyro
#

i can click 10/s and lose to my friends that click like 6/s

#

its strafing, positioning, and combos

vague oracle
#

then you have bad aim, but bad aim will make you lose in both 1.17 and 1.8 so it doesn't really mastter

atomic gyro
#

you want to get out of the way of their cursor, keep them in your cursor, and crit them while moving forward

#

if you drop them at any point you're getting hit back

#

anyways, I'm having an issue finding a file. Any reason why this is coming back with an exception?

File file = new File(player.getWorld().getWorldFolder(), "data" + File.separator + "minecraft" + File.separator + "loot_tables"
        + File.separator + "entities" + File.separator + "zombie" + ".json");```
This should be a file that exists.
#

data/minecraft/loot_tables/entities/zombie.json is the target file.

vague oracle
#

Don't know much but don't you only need 1 argument.

atomic gyro
#

What do you mean, as in I'd only need zombie.json?

quaint mantle
#

this is my error once i try build my 1.17.2 plugin

#

1*

#

this too

lost matrix
paper viper
#

iirc you don't need the file separators

worldly ingot
quaint mantle
#

/

paper viper
#

you can just turn them into forward slashes and java should already convert

worldly ingot
#

And yes, you're right. Forward slashes

atomic gyro
#

just realized that getWorldFolder is going to, coincidentally, get the world folder and not the .jar. Back to drawing board.

lavish hemlock
paper viper
#

Yeah i wanted to say to use Path

#

but idk ppl would run me down

#

lol

lavish hemlock
#

it's legitimately the better API

#

both in usability and performance

paper viper
#

yeah immutable strings

atomic gyro
#

Since so many people are here, how do I get to the minecraft.jar? Haven't been able to find a way to call it using Spigot yet.

paper viper
#

wdym

lavish hemlock
atomic gyro
# paper viper wdym

I want to call files that exist inside the minecraft.jar. Like data/minecraft/loot_tables/entities/zombie.json for example.

lavish hemlock
paper viper
#

^

#

and you have no idea where it could be installed as it can vary anyway

#

and not all servers have clients installed

#

in fact most servers dont

#

lol

atomic gyro
#

Just realized then, should I just make a datapack using the file function that has every default loot table in game, then I can access them whenever and it gets replaced from default?

lavish hemlock
#

that would get messy pretty quickly

#

besides, I believe datapacks are loaded on the server?

worldly ingot
#

They are

golden turret
quaint mantle
golden turret
#

change it in project settings

quaint mantle
#

is it the sdk version?

lavish hemlock
#

yeah

golden turret
#

right there

quaint mantle
#

which one should it be?

#

what version

golden turret
#

java 16

quaint mantle
#

got it

golden turret
#

minecraft 1.17+ now requires java 16

lavish hemlock
# worldly ingot They are

in that case, the server has access to datapacks.
I'm unsure if it's possible to programmatically modify a loaded datapack (my knowledge of the API is limited) but there's better ways than rewriting all of the default datapacks lmao @atomic gyro

atomic gyro
#

Yeah this has gotten a bit confusing.

tardy delta
#

whats the best way?

for (account a : accounts) {
  if (a.name() != name) continue;
}
return a;

or

for (account a : accounts) {
  if (a.name() == name) return a;
}
lavish hemlock
#

the second

golden turret
#

2

atomic gyro
#

I'm more or less just trying to get the data inside a loot table as a string so I can use it, but considering I'd need to either recreate it in a datapack or find a way into a file I can't access, I'm gonna have to go back to the drawing board.

lavish hemlock
#

the first would loop through the entirety of the list

tardy delta
#

i'm wondering why people actually use it then

lavish hemlock
#

oh and also

#

the first is just plain invalid semantically

#

as a doesn't exist outside of the scope of the for loop

tardy delta
#

its just an example

lavish hemlock
#

aaaand you should probably use .equals when comparing strings and objects in-general

tardy delta
#

iknow 🥺

lavish hemlock
quaint mantle
#

Should i use plugman to reload only my plugin not the server?

quaint mantle
#

something else then?

lavish hemlock
#

I used a plugin kinda like it once

#

forgot what it was called tho

#

it worked pretty well

stone sinew
quaint mantle
#

i have like 3 plugins, its a private server i dont think restarting is rlly needed

tardy delta
#

cant i return something in a lambda expression?

lavish hemlock
#

if it's a Function then it has the ability to return

#

(or if it's a Supplier)

stone sinew
lavish hemlock
#

but something like Consumer can't

tardy delta
#

in this context

quiet ice
#

Just beware that sometimes stuff works with reloads but borks on restarts

tardy delta
#

ah its a consumer

lavish hemlock
#

yeah, forEach is a Consumer<T>

#

you can't use a lambda here

#

bc you can't get the account out of the lambda scope due to effectively-final/final rules

quiet ice
#

you can never return a method inside a lambda

quaint mantle
#

i have a decent plugin manager its fine

quiet ice
#

A lambda is effectively an anonymous class

lavish hemlock
#

but I'm unsure, it generates the InnerClasses attribute on a class with a lambda so I assume so.

quiet ice
#

nope, it's a method internally

#

method + methodHandle

lavish hemlock
#

I'm curious as to see why it generates InnerClasses then, lemme look at the JVMS

quiet ice
#

well, a class is created at runtime. but that is not visible in the bytecode

lavish hemlock
#

hmmmm seems it's hard to find information on lambdas from the JVMS

#

oh lmao

#

that is comedic

#

so yeah

#

a lambda is only effectively an anonymous class, u right

round python
#

How would I replace a specific entity with my own custom one?

quaint mantle
#

quick question, does the index of getWorld from getServer go 0: overworld, 1: nether, and 2: end?

quiet ice
#

remove the entity from the game and spawn your custom one at the same location

round python
#

Would I use entity spawn event?

#

Like it would check for that specific entity using instance of that specific entity, then it removes it

#

Then it spawns in mine right

#

Problem is my class extends that specific entity and instanceof includes subclasses so should I make an object of that specific entity and check for whether the event.getEntity equals that specific entity?

quiet ice
#

obj.getClass() exists

round python
#

Oh ok I’ll just use that then thanks

#

Appreciate it

upbeat ice
#

Anyone know how many decimal places a Java program double will solve before rounding

#

Pls ping me if you respond

quaint mantle
#

Worlds.get(0, 1, and 2) would return the Overworld, Nether, and End respectively right?

eternal oxide
#

yes

#

probably

#

depends on what is enabled in what order, but 0 is always overworld

worldly ingot
#

You'll never have a guarantee of that

#

Even world_the_end and world_nether aren't guaranteed

eternal oxide
#

Lets just say no guarantees, but I've never seen an occurrence where 0 wasn't overworld, even after many reloads

quaint mantle
#

on what is enabled?

#

hmm actually i could work with that, thanks for the help

rapid meteor
#

Bois why do my plugin.yml say that permission.yml is empty?

eternal oxide
#

I'm pretty sure it doesn't say that

rapid meteor
#

I mean it says permissions.yml is empty ignoring it.

worldly ingot
#

That's a message from Bukkit. You can ignore that lol

rapid meteor
#

Why doesn't my plugin work then?

rapid meteor
worldly ingot
#

If your plugin isn't starting it's for some other reason. Let's see your full server log

#

?paste

undone axleBOT
rapid meteor
#

I'll send you.

tardy delta
#

whats the best way of making a yaml file? putting a default one in the jar or creating one yourself on enable?

eternal oxide
#

If you want comments, put one in the jar

worldly ingot
#

Depends on the situation but generally speaking it's much easier to just have a regular file you can copy

#

Having to write it out in a more verbose manor just doesn't make sense ;p

tardy delta
#

oki

worldly ingot
#

new HashMap<>(theOtherMap);

austere cove
#

yo what's the point of the bitmask @ #getAsInt()

heavy void
#
LargeFireball fireballprojectile = player.launchProjectile(LargeFireball.class);
                        fireballprojectile.setVelocity(fireballprojectile.getVelocity().multiply(1.5));
                        fireballprojectile.setIsIncendiary(false);
                        fireballprojectile.setFireTicks(0);
                        fireballprojectile.setShooter(player);

How can i make this break blocks?

woeful crescent
#

Why are you trying to iterate through a HashMap?

#

Can I see the error?

silver shuttle
#

Is there a way to cancel a player right clicking? So say I want him to be able to right click once and not hold it, so he has to continuously click?

eternal oxide
#

<ItemStack>

tardy delta
#

:/

eternal oxide
#

or do it properly and synchronize

#

oh CME, yeah, clone

vague oracle
#

you need to use keySet() or values()

eternal oxide
#

or add all the items you want to remove and remove them after

#

or use an iterator, then you can remove

woeful crescent
#

Anyone know if Damageable#damage(dmg, source) calls EntityDamageByEntityEvent?

eternal oxide
#

an Iterator is teh correct approach.

vague oracle
waxen plinth
#

Consider naming your variables descriptively

woeful crescent
eternal oxide
#

yes, but its not a good idea

waxen plinth
#

Wouldn't that effectively clone every time

#

What is getBingoItems returning

#

Bruh

#

Why are you creating a new one

#

Why

quaint mantle
#

?

eternal oxide
#

You just need to handle your data safely

waxen plinth
#

My god

#

You don't need to clone the entire map for that

woeful crescent
#

Just don't use an enhanced for loop?

waxen plinth
#

And it won't even prevent CME

eternal oxide
#

with an iterator you can safely remove elements without cloning anything

waxen plinth
#

Use a regular for loop and just do list.remove(i); i--;

#

Iterator is also a good solution

eternal night
#

removeIf is also cute

waxen plinth
#

If you're not doing anything but removing specific elements (or if you are removing multiple) use removeIf

waxen plinth
eternal night
#

tbf yours has more info xD

tardy delta
#

ugh can i put an message with a ' in a yml string?