#help-development
1 messages · Page 305 of 1
k
?
tabnine 💀
when i make a nether portal it spawns exactly in the overworld location/8, it doesnt look for empty spaces
Yeah, well, it's as I've thought, the item in the arm itself cannot be rotated like on your picture, you have to move the arm outwards and then fold it inside, so L and R become switched and the item is higher up than normal. No idea how to do this otherwise. Since euler angles are additive, it becomes quite a pain thinking about how to compensate for rotations. What are you trying to accomplish? Is the armor stand going to be visible? How should the final pose look?
Maybe you should explain what you're trying to do first, as I cannot just throw complete implementations at you, since you would then again probably not know how to use them.
the armor stand isn't going to be visible. i am creating an ability for a player to throw their sword, so i am trying to achieve a sword looking in the players looking direction
setRightArmPose(EulerAngle pose) - sets the current pos
You must watching out the EulaAngle to set (0|0|0)
puplic static final EulerAngle ZERO = A EulerAngle with every axis set to 0
puplic EulerAngle(double x, double y, double z) = Creates a EularAngle with each axis set to the passed angle in radians
or you want to set y axis only.
public EulerAngle setY(double y)
getting this way
public EulerAngle getY()
Oh, well then you could have just experimented with these values until you found a pose you like and just hard-code that, lol. I once made this little debug utility where you can click (playerinteractevent), and while you hold that button, move-events (yaw) is scanned, delta between last and curr is calculated and that delta is added to the currently selected euler angle. This can be useful to generate rotations like these.
i don't really see what does my question have to do with armor stand arm poses
I just experimented around, looks like the last three values in chat could do what you need
thank you very much!
With euler angles it really is the quickest and easiest to just do it and see if you like the outcome. I think there are even multiple ways to reach the same end-pose, so it's hard to define this mathematically. And I'm hella tired too, xD.
And we don't see what your question really asks, as you provided way too little detail.
i have a vector and i want to rotate it 90 degrees around its tail
imagine the vector is the player's direction
I think you mean getBodyPos()
the vector should then point to the left of the player
after i have rotated it 90 degrees
Around it's tail, so around the origin. That's even easier. 90 degrees on which axis tho?
this is an example, i could need to rotate it both on yaw and pitch and of a different angle than 90
Watch out EulerAngel
https://paste.md-5.net/xusacelafa.cpp
This is what I threw together just recently to get something done. you just call rotateXYZInPlace, where base is what you input and handle is the vector which will get the result stored in place. angleX/Y/Z are the rotations on the corresponding axies while shiftX/Y/Z let's you move the rotation origin. Just leave shift at zero, y/z or y/x at zero and set the remaining angle, while inputing the player's eye location's direction as the base.
do you really need matrices tho? it seems a quite inefficient approach
Depends on what you're trying to accomplish. The rotation of a fixed 90 degree angle is well defined and can be also computed without them.
Hey I got a short question. I am picking a Player in a 'Public static void' and I am storing his UUID in a variable. Now I want to access that variable of the UUID outside of this method, but I can't and don't know how. How can I do it?
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
public static void pickPlayer() {
if(Bukkit.getOnlinePlayers().size() > 0) {
ArrayList<Player> players = new ArrayList<>(Bukkit.getOnlinePlayers());
Player player = players.get(ThreadLocalRandom.current().nextInt(players.size()));
Player choosenPlayer = player;
player.sendMessage("Yo it worked!!!");
} else {
return;
}
}
public void testMessage() {
System.out.println(choosenPlayer);
}
}```
what's the point of this? just a shorter version of while(true)?
wait what
yea that's the equivalent of while(true) { ... }
can i do smth like for (i;10;++)
since the ; is a seperator for the var initialization, the action on each loop cycle and the conditon, and they're all empty, it's just an infinite loop
oh then no
you can see the for loop as just a while loop which looks like the following
// this for loop
for(init, cond, cycle) {
code
}
// is the equivalent of:
init
while(cond) {
cycle
code
}```
Cant say ive seen a for loop written with the i++ in the center
o oops
Lol
the main difference between for loop and while, is that you can use do-while. That is perform an action so as long as it is true or false. A for loop has an end to it unless something constantly updates what the end condition is.
is there any difference between Player#getEquipment()#getItemInMainHand() and Player#getInventory()#getItemInMainHand()?
yes, one uses the inventory interface, the other doesn't
will i get the same item?
yes
k thanks
While not traditional, you can use a for loop to iterate over an iterator
for (Iterator<String> iterator = list.iterator(); iterator.hasNext();) {
String value = iterator.next();
}```
Also a lesser known fun fact about for loops, you can modify multiple variables in the increment
for (int i = 0, j = 0; i < 10 && j < 20; i++, j += 2) {
System.out.println(i);
}```
why did you move out declaration of i and j tho?
btw will performance be significantly affected if i use
IntStream.range(0, number).forEach(i -> { /* code */ });
instead of simple loop to just do something N times?
I think something that should be added in regards to iterator, is that ListIterator exists
and the advantage a ListIterator has over a normal one, is backwards traversal
Yes
never used it, i always did a reverse loop
k ill use for then
isnt just the generation of the stream slow but not the looping?
Foreach is best used with Arrays and Collections like with LinkedList because it is more optimal then a for loop
Both are technically iterators, one is internal the other is external
possibly, but probably wouldn't even notice it lmao
it probably only keeps track of the min and max
assuming it only stores a whole segment of integers and not just random ones
never used an intstream tho 💀
ah it doesnt
if they need an array super quickly
they could do this
int[] arr = new int[end - start];
Arrays.parallelSetAll(arr, i -> i + start);```
fills the array very quickly especially if its a large array
ye ik about setAll
IntStream.range() is effectively the same as using a for loop
well i once used it instead of a for loop
and you can
however foreach itself is an interator that is internal, unlike the for loop so there is times where it is better to use it over the for loop
just depends on what you need really
i just asked and decided to go with normal for loop
indeed they did 🙂
and got a response that met their requirement for satisfactory response levels
L?
?paste
How might I get hold of the Bukkit instance in order to getMethod().invoke() on it?
Bukkit.class.getDeclaredMethod(x).invoke(Bukkit.getServer())
Oh, getServer() has all the same methods of the underlying Bukkit class.
Superb, thank you.
static Object[][] goods = new Object[10][10];
static void someMethod(Scanner sc) {
// some code
String name = sc.next();
String costRaw = sc.next();
while(true) {
try {
double cost = Double.valueOf(costRaw);
int slot = firstEmpty();
goods[slot][0] = name;
goods[slot][1] = cost;
// messages
break;
} catch (NumberFormatException ex) {
System.out.println("Cost must be a number! Enter cost again.");
costRaw = sc.next();
}
}
}
static void printArray() {
for (int i = 0; i < 10; i++) {
Object o = goods[i][1];
System.out.println(nameFormat(goods[i][0]) + (o == null? "0": ((Double) o).doubleValue()));
}
}```
imagine being me
love it how you can be serious for some time and then you start sending gifs
lol
how do ppl go with attaching armorstand to the player
if we move it there are some delays that client sees
it has to do with mounting right
Hi, i have this currently. How would I disable the damage of the enderpearl?
packets
ProjectileHitEvent > getEntity
when the armor stand is a real entity it follows the ticking rules
@fiery prairie
so, while although you told it to move, it won't move at that exact instant
what if X plugins do the same at once
however you can tell the client it did move instantly 🙂
Alright thanks, I'll try something
what about ping and shit
not relevant because on that particular client everything else would be lagging at the same speed
if you are spawning it
and if i wanna mount?
if you want it to move larger distances, you use the teleport packet if movement is greater then 8 blocks I think it is
you would use the metadata packet and some other packet I think
i see
how can you turn yaw and pitch into a vector?
Not sure if that has anything to do with the damage of the enderpearl but im probably stupid or something
location has to vector method or something to that extent
it used to be 4 iirc but i don't remember if it was changed
prob was
getDirection() on a location would return a normalised vector that points in the direction of the yaw/pitch
how does the pitch work there? does it go from -90 to 90?
i've just found the method
toVector() on a method does not care about yaw and pitch
it just creates a vector with the x y and z of the location
i meant how does pitch work in locations
is 0 when you look straight forward?
then -90 when you look straight down and 90 straight up?
the javadocs should clarify this
declaration: package: org.bukkit, class: Location
they do
alright thanks, i'll try the code there
the method returns a normalized vec doesn't it
your issue is going to be with yaw btw
is it me or is this wrong
input: player.sendMessage("vector: " + VectorUtils.getSphericalVector2(Math.sqrt(5 * 5 * 3), 45, 45));
output: -4.33, -6.12, 4.33
because you can have 360 and -360
the difference here is that positive means turning their head clockwise if its negative they are turning their head counter clockwise
this is rounded but you should get the idea
public static Vector getSphericalVector2(double radius, double yaw, double pitch) {
Vector vector = new Vector();
double xz = Math.cos(Math.toRadians(pitch));
vector.setY(-Math.sin(Math.toRadians(pitch)));
vector.setX(-xz * Math.sin(Math.toRadians(yaw)));
vector.setZ(xz * Math.cos(Math.toRadians(yaw)));
return vector.multiply(radius);
}
``` this is the method
i've put that value as the radius so the 3 vector components should be 5
and also i don't understand why is the y negative
however if you don't care which direction they are moving their head and just want the yaw
use absolute
and also distorted compared to the other locations
i don't need that, i just want to make vectors for animations
I was just letting you know the caveat with yaw
i appreciate that
as sometimes people get tripped up when they get results of negative values 😛
but i don't know if i don't understand how it works
but i'm pretty sure this is not supposed to happen
these values kind of make no sense
can't even trust the api :c
do you guys understand this? https://github.com/SpongePowered/Configurate/tree/master/core/src/main/java/org/spongepowered/configurate
it's so segmented
and generic looking
configurate is cool
but do you guys understand it?
what do you mean understand? have you looked at the wiki
without looking at the wiki
i'm not interested in the usage, i'm trying to learn from it
learn what
i feel my code style is much simpler than this
so any other way to convert yaw and pitch to a vector?
this is robust, platform agnostic, performant code. i don’t know what to say to this
looking at the api
the way you could do it is to create a new vector
let x be your pitch, and z your yaw setting y to 0
should be able to use most of the vector api for your needs if done that way
If you have a yaw and pitch you likely have a Location they came from
Location#getDirection()
i don't, i need a method to create circular motion animations and so i am providing yaw and pitch by hand
then you have to calculate it using cos and sin
that's what i was doing, i've copied the getDIrection method but the values it returns are kind of messed up
.
can't look at code at the mo
Can someone tell me where is the JavaPlugin in 1.19.3 build tool which used to exist in 1.8.8?
yes
IllegalAccessException when calling .size() on a Collection using reflection, but not when done directly in code. Any idea what might be causing this? The collection in question is the result of Bukkit.getServer().getOnlinePlayers().
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Why are you using reflection for that?
Also show your code
?paste
Because I'm getting data based on arguments supplied in config.yml and there are too many things to hand write code for each option so I am using reflection. I have great success retrieving the Collection itself and can print it out to the console, but calling size() on it causes an error.
what
I get
java.lang.IllegalAccessException: cannot access a member of class java.util.Collections$UnmodifiableCollection (in module java.base) with modifiers "public" on that one method.
If I leave off the '.size()' part I get the collection just fine and can print its contents. If use the same process on 'getMaxPlayers()' it works fine. It seems to be something with calling .size() on a collection using reflection.
Wouldn't this try to run size on the wrong class
How so?
Yeah, I get the Collection back okay.
It does, I actually have logic further up the class that checks all that first.
It also works fine on getOperators().size(), though getOperators returns a Set, not a Collection.
how can I offset a location to the right/left of the player?
FieldUtils.readField(protocol, "f");```
some1 have a better reflection util class than protocollib? 🤣
use fieldutils from apache
also i think you need to include a parameter which is something like force
that basically sets the field accessible
that's how it works with the apache utils class
not sure about yours
You want getDeclaredMethod
Thanks md, I did try that though. A slightly different exception I think but same result.
Lemme just spin it up again and see what the error was.
Hmm, 'NoSuchMethodException'. I don't recall it being that last time I tried, but there it is.
To be precise: java.lang.NoSuchMethodException: java.util.Collections$UnmodifiableRandomAccessList.size()
It’s probably part of a parent class, what happens if you lookup the source for UnmodifiableRandomAccessList?
How do I do that?
Are you in intellij?
Yup
Write out the class UnmodifiableRandomAccessList import it and AlT + left click
smh, in eclipse it doesn't require clicking or anything
size is part of the collection class.
I've found the definition for UnmodifiableRandomAccessList in Collections but I don't really know what I'm looking for here.
@last bolt Nothing i’ve checked
You can get the method you want bt doing Collection.class.getMethod(“size”) and invoking that on your lidt
List
Or similar am on my phone
I'll give that a whirl now.
get the internal array and call ::length on it :))
Nahh
Thanks Jan, I've implemented a branch to use Collection.class.getMethod() directly if the returned type of the previous invoke() was of type Collections$UnmodifiableRandomAccessList and it works. Fingers crossed I don't end up with a huge list of exceptional types I need to look out for to implement similar workarounds.
he is java native speaker
wha
in RaytraceResult#getHitBlock return docs says the hit block, or null if not available. what does it mean not available?
wouldn't then raytrace result be null
it says he ray trace hit result, or null if there is no hit
in World#rayTraceBlock
I'd assume they can just do the math for raytraced location without loading chunks
raytraceresult can also have an entity
in a result an entity could be available but a block could not be available at the same tie
time*
What mesaage broker will u recommend? because i need one which works as fast as redis but having the security that the data will never get losted
Because thats the main issue that we're experimenting at our project thanks
What's wrong with Redis?
using nbtexplorer should do the trick
sounds like a skill issue
intellij has a plugin to edit nbt files
NBTExplorer
I'd 100% use redis
Without insulting my whole family, can you tell me if this should work?
ItemStack clickedItem = e.getCurrentItem();
if (clickedItem.getType() == Material.DIAMOND_SOWRD) {
if (!p.getInventory().getBoots().equals(Material.CHAINMAIL_BOOTS)) {
if (playerInventory.contains(Material.EMERALD, 4 )) {
playerInventory.removeItem(new ItemStack(Material.EMERALD 4));
p.getInventory().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));
p.getInventory().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS));
}
}
}
it would probably do something, thats for sure
what is working in your eyes
like whats it supposed to do
This give me the armor but dont remove the 4 emerald
well I dont think you can remove a new itemstack
you can get the emerald stack and decrease the amount by 4
in playerInventory.removeItem() ?
oh or you could do getItem instead of using new ItemStack
like use Inventory.first to get the first emerald stack
and then use removeitem with that
its not completely fool proof though, but if you want to make a shop there are more robust ways in any case
Like?
Is there any way to get a player list of existing Minecraft accounts
Do you mean all of minecraft account created?
yea
In a plugin?
yea
I dont think so
@faint totem
I need some help on my forum topic can anyone view it to help me https://www.spigotmc.org/threads/help-with-config.585630/
Too old! (Click the link to get the exact time)
yes 1.8.8
😔
But it's about config I think it can be solved
if you can look at my topic
Hey. Does somebody know what they mean with 'Entity source'?
https://jd.papermc.io/paper/1.19/org/bukkit/World.html#createExplosion(org.bukkit.entity.Entity,org.bukkit.Location,float,boolean)
declaration: package: org.bukkit, interface: World
I just wanted to know how I can create names in the config to be drawn in my mystery box, but each name with its rarity
hmm yes
probably that
i dare anyone to sit on that irl
Oh yeah thanks, but I don't understand exactly what the source is. So what could I put in there(except from null), if you know? ^^
yes exactly that
Thanks ^^
only I wanted to make it raffle an item of some rarity with a list of items within the rarity
example
Can you help me with this?
I did like this
I did it like this because I'm Portuguese but it's the same scheme
I just wanted to put a custom name on the items in the rarities list
Because when they are drawn, the name will appear on the mystery box reward armorstand
such that?
I did it like this and it worked, but I wanted to name each item Hat example: '&a[Common] Hat'
can you teach me how to do this to show how i want to do it
The only way I can do it is by list but then I can't by custom names
this code
I really don't know how to do this sorry ☹️
I do not know much so I need so help I do not know java
would you have an example base to show this?
It is not building
I'm a little newbie at this yet sorry
yea same
ok thank you
Could not find artifact com.mojang:authlib:pom:1.5.21 in central (https://repo.maven.apache.org/maven2)
Could not find artifact com.mojang:authlib:pom:1.5.21 in central (https://repo.maven.apache.org/maven2)
wdym
I wanted to know how to leave the name of the string customized by the list
Helppp, I don't understand why this doesn't work:
[16:38:45 ERROR]: Error occurred while enabling SmcLimbo v0.1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.plugin.RegisteredServiceProvider.getProvider()" because "rsp" is null
at me.ferju.smc.Main.setupVault(Main.java:77) ~[SmcLimbo-1.0-SNAPSHOT.jar:?]
at me.ferju.smc.Main.onEnable(Main.java:42) ~[SmcLimbo-1.0-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[purpur-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[purpur-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:541) ~[purpur-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[purpur-1.18.2.jar:git-Purpur-1631]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:474) ~[purpur-1.18.2.jar:git-Purpur-1631]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:669) ~[purpur-1.18.2.jar:git-Purpur-1631]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:436) ~[purpur-1.18.2.jar:git-Purpur-1631]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:352) ~[purpur-1.18.2.jar:git-Purpur-1631]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1179) ~[purpur-1.18.2.jar:git-Purpur-1631]
at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:320) ~[purpur-1.18.2.jar:git-Purpur-1631]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
[16:38:45 INFO]: [SMCL] Disabling SmcLimbo v0.1.0
Here goes the code...
The code is to check if Vault is enabled:
private boolean setupVault() {
if (getServer().getPluginManager().getPlugin("Vault") == null) {
Utils.LogWarn("Vault not found, Vault utils will not work.");
return false;
}
RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
vaultPerms = rsp.getProvider();
return vaultPerms != null;
}
I do have Vault installed on the server as well as LuckPerms
and yes, Vault is set as a dependency, as well as LuckPerms as a soft dependency which I think I don't even need xD
nevermind, I just had to change my gradle way of import lol
i better hope that query isnt done sync
as well? I didn't understand
Hat:
Name: '&aCommon Hat'```
What I wanted to do is this, but with other rarities and to raffle off any of the items that are common, rare, etc.
Cannot resolve method 'getDataFolder' in 'Plugin'
its JavaPlugin
and should use File.separator instead of "/" or it will break on non windows things
or just do new File(plugin.getDataFolder(), path)
it's actually not / on windows 😄
\\ is windows
You have the wrong import
You can use plugin, you don’t have to use JavaPlugin.
Hey bro I got it done the way I wanted @last temple
public static ArrayList<String> colorArray(String string) {
String[] splittedString = string.split("@");
ArrayList<String> strings = new ArrayList<> (Arrays.asList(splittedString));
ArrayList<String> finalStrings = new ArrayList<>();
for (String str : strings) {
ChatColor.translateAlternateColorCodes('&', str);
finalStrings.add(str);
}
return finalStrings;
}
umm help, am trying to make something that splits and colors (with the color code) a String, seperering it into a array
for lore
and tis is not working
Can I create multiple configurationsection or not?
String rewards = "";
ConfigurationSection comum = Main.instance.recompensas.getConfigurationSection("Recompensas.Comum");
for (String key : comum.getKeys(false)) {
try {
String name = comum.getString(key).replace("&", "§");
if (type == Rewards.COMMOM) {
rewards = name;
MySQL.updateUItem(p, name);
}
} catch (Exception e) {
e.printStackTrace();
}
}
return rewards;
}```
I created it like this and I want to put another one for the rare item, I can make another configuration section or it's ok
Okay thanks
I have another problem, I wanted to know how to make it draw an item inside the configurationsection that I made
I wanted to make that if the item was of the common rarity it would draw one of the names that are within the common
Anyone have an idea on how I could make setItemMeta() more performant if I have to call it on almost every item that drops in the world?
Set it on pickup?
Would that even make a big difference? Since almost all of those items are picked up eventually
So it would just move the load to another point
not all items are picked up
oh you mean in your case
hm
Yeah since those items are coming from giant farms
Just setting the lore in ItemSpawnEvent
And setting some keys in the PersistentDataContainer
It depends on the item
I doubt you could optimize it much then
Async won't work since it's not thread safe
exactly
Hello, I experimented a bit with LootTables. My plan was to give my chest this LootTable, but the chest is empty. These LootTables are really complex, so if anyone could help, that would be really nice ^^
Block chestBlockLocation = chestLocation.getBlock();
chestBlockLocation.setType(Material.CHEST);
Chest chest = (Chest) chestBlockLocation.getState();
chest.customName(Component.text("§cMeteorite"));
Inventory chestInv = chest.getBlockInventory();
ItemStack test = new ItemStack(Material.STONE);
chestInv.setItem(5, test);
chestInv.contains(test, 10);
LootContext context =
new LootContext.Builder(chestLocation).lootingModifier(player.getLevel()).build();
LootTable lt = new LootTable() {
@Override
public @NotNull Collection<ItemStack> populateLoot(@Nullable Random random, @NotNull LootContext context) {
int loot = context.getLootingModifier();
double lootingMod = loot * 0.2;
final List<ItemStack> items = new ArrayList<>();
if (random.nextDouble() <= (.05 + lootingMod)) {
int dropAmount = random.nextInt(3);
items.add(new ItemStack(Material.LEATHER, dropAmount == 0 ? 1 : dropAmount));
}
return items;
}
@Override
public void fillInventory(@NotNull Inventory inventory, @Nullable Random random, @NotNull LootContext context) {
}
@Override
public @NotNull NamespacedKey getKey() {
return new NamespacedKey(JavaPlugin.getProvidingPlugin(MoonLightMC.class), "extra_meteorite_loots");
}
};
chest.setLootTable(lt);
chest.update();```
anyone able to help with a texture pack. I cant figure out why its not applying to my model
im guessing it has to do with my format of my model in model.json but cant pinpoint what im doing wrong
I'm trying to use caffeine's AsyncCacheLoader for my plugin. I setup a removal listener, but when the server shutdowns obviously everything is removed async which isn't exactly ideal. I looked through Caffeine's docs and it seems there is absolutely no way to run it sync without triggering the removal listener that's in place for when the server is running. This is mildly annoying because this ruins the convenience of using a AsyncLoadingCache in the first place. purely because when the server gets shut down the data won't have time to save. Any ideas on how to improve my cache setup or get rid of things at server stop?
There's no way to join the cache threads to main?
What are you doing with a LootContext?
got it.
TEXTURE LOADING CHANGES
To improve loading performance, block and item textures are now loaded before they are processed by block and item models
By default, textures not in the textures/item and textures/block directories will no longer be automatically recognized and will fail to load
1.19.3 change notes: https://feedback.minecraft.net/hc/en-us/articles/11280166737293-Minecraft-Java-Edition-1-19-3
not that I know of
I mean no I can't find anything
Do I not need one? :o
no
Oh okay, I really have no idea how these LootTables work :(
LootContext applies to mobs
Oh okay
why not set a variable called savingOnDisable and set it to true when you're going to start removing frm the cache and saving on disable
if savingOnDisable is false, let your listener not do anything
I suppose :/ I was hoping for a fairly clean solution
don't think you understand how caffeine is setup, but no
my current setup is a saveUser future method, on disable I just take the sync view and save that user calling join method on the future
my main issue was seeing if I could dodge the removal listener, but minions variable idea does work, while not necessarily clean
so you're saving in the removal listener?
my setup is pretty specific but I personally check if it was removed via the explicity type, if it was that removal type let whatever removed it explicity handle any optional saving
thing is most of the time my removals are Explicit
I am saving data based on a spigot event not off of cache policy
rip
I could technically save off of a cache policy, but that'd also cause background tasks to be running that just don't need to be
Not sure why this would be an issue
If you are saving to a db periodically just create a daemon thread specifically for db calls
Then it doesnt really matter what is going on for that thread as it would be separate from the main thread
I don't mind whats going on, on the other threads was just looking for a decent way to save with Caffeine, which minion suggested. Don't necessarily feel like making my own cacheing api with the features caffeine offers
./summon fireball?
that summons a fireball hovering but not fired
i want to make a pikachu and the thunderball move is using mythicmobs
and
i summon a fireball with electric particles i did that but it doesnt fly naturally
it just hovers
its a husk
i doubt it can have a click triggered
not by /summon
i think you can /summon a mob with invis right?
you can
You can use a normal CacheLoader
Its not like that thing isnt thread safe if u get what I mean
Also because the notion of sync is relative
bruh
just realized theres a half assed ArmorEquipEvent in spigot kinda
GenericGameEvent
Mye
Mye
poor alex
I never really used those events
spent so long makig it
NMS <:
you still need to use alex's event if you need any information other than the fact that armor was equipped
hey guys
i'm new in minecraft plugin development, so the question is pretty simple
what event is called when a player moves an item to a container or back?
Inventory click event and inventory drag event are the two you will utilize. Inventory move event is used for hoppers
yeah I have already found out by myself that InventoryMoveItemEvent is for hoppers
well
I thought there should be an event fired when you move an item across the inventories
I slightly don't get how to use InventoryClickEvent and InventoryDragEvent
can u please help?
my code when I used InventoryMoveItemEvent by mistake was ```java
@EventHandler
public void onRemove(InventoryMoveItemEvent event) {
ItemStack item = event.getItem();
if (item.getType() != Material.DEBUG_STICK) {
return;
}
else {
Bukkit.getLogger().info("Stick was (not) moved to a container");
event.setCancelled(true);
}
}
I just want to disallow people on my server to put debug sticks into containers
Then just cancel the InventoryClickEvent if they click on a debug stick. If you want them to be able to move the stick around in their inventory while they are viewing a container, you can compare the slot where they are trying to move the stick.
im looking to make it so that specific dropped items cannot explode/burn. is entitydamageevent the only way to do it?
Entity or Block explode event
they both should have a way to get blocks being blown up
i said dropped items :p
the entity explode event might do that
i dont think it has getEntities()
declaration: package: org.bukkit.event.entity, class: EntityExplodeEvent
actually
this will probably be something like a creeper exlpoding
some of these event names
mhm
i think ill just have to use entitydamageevent for this and check whether damage type was explosion && entity was item
looks like they dont have any method for re-setting the explode list so i would guess the damage eent
yeh
So I am adding features to a plugin for someone, this plugin has a stats.yml file. Gets updated with players in game stats. Basic enough.
There is a lobby server and a game server, both running this plugin. Somehow the stats.yml file is synced on both servers but I can't find any logic in the plugin that would do this.
Is there some built in function I am missing here?
Any help would be great
No, it is not my plugin
which stats are synced
Sec
plugin might have some messaging support
I can see the SQL implementation but it's not been put in
I have asked the server owner
This is the only time these stats are really saved in any way
and it just looks like standard saving 🤷♂️
the answer to this was nope
still at a complete loss
took years
Hello,
Not sure if this is the right place to ask this.
I've gone through the server chats for similair answers, but it looks like there is no 100% clear answer.
Whats the situation on releasing plugins? What cannot be released, because of copyright, only nms imports?
Is there perhaps a guide/link for a way to correctly compile a plugin, making it distributable?
well
you can depend on nms
What exactly do you mean with this? Also, would there be no problems if I would just not use nms?
this
"Any Mods you create for the Game from scratch belong to you (including pre-run Mods and in-memory Mods) and you can do whatever you want with them, as long as you don't sell them for money / try to make money from them and so long as you don't distribute Modded Versions of the Game. Remember that a Mod means something that is your original work and that does not contain a substantial part of our code or content. You only own what you created; you do not own our code or content."
from eula
you can use nms imports
that is fine
I believe so
injection is also kind of ambiguous
but "in-memory Mods"
I assume it falls under that
It seems like Im misunderstanding something.
Wouldnt this imply that it is not fine to create plugins and sell them?
Or, would it imply that it is fine, since its not mojangs code, but spigots instead.
So I understand it is that spigot plugins depend on the spigot api
as such, they're completely commercializable
Minecraft has commercial usage guidelines. https://www.minecraft.net/en-us/terms#terms-commercial_guidelines
Although it mostly covers server related monetization, the rules are pretty lax so long as you aren't trying to impersonate the brand or distribute pure mojang code. It's even stated later in the guidelines to just use common sense. It should also be noted that there is a difference between mods and plugins. Although mojang/microsoft reserve the right to declare what constitutes a "mod", it's been pretty clear that spigot plugins aren't mods. It's just due to the nature of what spigot is. Spigot is free modification of the vanilla server jar. So it fits within the rules of the EULA.
The important part to remember is that Spigot is an API. So plugins that use the API aren't distributing mojang code, they are distributing spigot code. Hence, they are allowed to be monetized.
I see, thank you for the explanation.
as for the part they are free to declare what constitutes as a mod, they may be able to do so in other countries but not in the US as its already defined in what is considered to be an extension or derivative work
as well as there is case law to back up such definitions
is there anyway to remove slash command which was created by my bot? (JDA)
making a plugin that use / features. want to register command onEnable and remove onDisable
is there a way to convert item meta into org.bukkit.attriubte.Attributable?
You should be able to remove them by pushing a new list of slash commands. It'll take like 30 minutes or so to update on discord.
iirc they had a method to update commands but idk if it updates global
isn't there something like unregister command?
what is that?
might be something like updateCommands
You can indeed remove global commands.
It'll just take some time to fully propagate to servers.
umm, so only global command can be removed and it will take upto 1 hour?
you can remove guild commands iirc i just dont remember how
IIRC, there were some weird rules for guild commands.
okay, I will figure this out
I need more 1 help.
its saying I need to call OptionData#setAutoComplete(true)
but where? it didn't show any example
auto complete is default from what i remember
It's been a while but, I believe the difference between global commands and guild commands is whether or not you use the Guild class.
Guild#updateCommands() vs JDA#updateCommands()
Also, I believe that guild commands are instantly updated.
im just checking, is this the best way to check what an object actually is to return its pdt? i couldnt find any valueOf type method on the jds https://paste.md-5.net/fedinixeci.cs
you can register guild commands
my brain typed that before i read the Guild is just for guild
its a non ssl certified domain, you have to enable it in settings.xml in maven
i cant find settings.xml
should i just create a new one next to pom.xml
it would have to be in maven home from what i remembere
idk what this is
@wet breach you maven right?
yep
could u help me
in a bit i can
ok just ping me pls
How do you resolve an ADD_SCALAR (Operation 1) attribute modifier on an item?
I wouldn't change the main settings.xml file. You can use a different settings file so long as you specify where it is. (It can be in the project folder)
check meta for attribute
wdym?
public class PlayerGrimaldelloListener implements Listener {
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
Block block = event.getClickedBlock();
ItemStack item = event.getPlayer().getInventory().getItemInMainHand();// Check if the player is clicking on a iron door if (block != null && block.getType() == Material.IRON_DOOR) { Door door = (Door) block.getBlockData(); // Check if the player is holding the specific stick if (item.getType() == Material.STICK && item.getItemMeta().getCustomModelData() == 303002) { // Open or close the door door.setOpen(!door.isOpen()); block.setBlockData(door); } } }
Why when in game I stick click with CustomModelData equal to "303003" the iron door doesn't open?
like #addAttriubteModifier?
yeah
i mean something different,
because you check if it equals 303002 not is that or higher
Hey Guys i have a question, is it possible, to change the plugin GriefPrevention like "u can´t break blocks of other people claims" but u can "use tnt to break their claims" i want to make a Minecraft Server what is like the game "Rust" does it work ? or how can i make it work
Are you sure the stick has the model data tied to it?
i wanna calculate their values myself
check stash
i have a list of attribute modifiers with this operation, how do i calculate it? it depends on attributes base value, but how do iget that for an item
how can i do this could u help me
i havent done maven before
I made a mistake typing the number, obviously the CustomModelData of the Stick is identical to the one in the code, but it still doesn't work
print the custom model data before the check
Like that?
I haven't had many reasons to use the settings.xml file and frostalf would probably know more than me, but I believe that you can make a .mvn directory in your project and create two files.
maven.config
local-settings.xml
The first file just declares what setting file to use when the compiler starts to run. The second file is the file that you will point to in the config file. Then you can setup your mirror rules in the settings file.
Idk why the repo you are trying to use isn't using HTTPS, but you should probably ask the dev to fix that.
that wont print it
System.out.println(item.getItemMeta().getCustomModelData())
done but it still doesn't work in the game
look in console for the data
you are printing the value so you can check what it is
That's what I did, right?
But for some reason it doesn't work
sysout something after the door.setOpen
oh wait
i know your issue
its running once for each hand
?interactevent
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
how do I do it so when I plant a wheat seed with a specific name it starts monitoring and when the wheat grows completely it replaces the block
So at the beginning I have to add:
if (event.getHand() != EquipmentSlot.HAND) {
return;
}
Right?
Indeed you are right
player interact just check if they right click farmland if and the name checks
then do your checks on it
bruh i think was just typo on their website
i changed http to https in their repositroy
and it works lmfao
it still doesn't work in the game
add a sysout after each if statement and see where it gets to
are you using maven that is part of intellij or maven stand alone
intellij
well it works now cus it was meant to be https instead of http
but now i get Caused by: java.lang.NullPointerException: Cannot invoke "com.nametagedit.plugin.api.INametagApi.setNametag(org.bukkit.entity.Player, String, String)" because the return value of "com.nametagedit.plugin.NametagEdit.getApi()" is null
need to declare it a dependency in your plugin.yml and ensure it is present on your server
can't just depend on something and then it not be there
how can i make the checks?
whoops
for future reference, intellij uses the settings.xml from this location C:\Users{user}\.m2\settings.xml
also projects can override the global as well by including a settings.xml in the root project folder
Apparently everything works up to the part of the code highlighted in green, from the part highlighted in yellow it no longer works
ok also does the version in the dependency hav eto be the same as the jar
Now when others use it, and don't have that dependency it will in a more kind way tell them that 🙂
typically this would be ideal
Wdym?
does the jar on the server have to match the version in the dependency listed in the pom
is what I think they are referring to
but an easy fix is just to depend on the updated version
Ohhh, that's cause it's using the Legacy material names.
What version are you using?
1.8 🤡
Version of what? of minecraft (and the minecraft server) 1.16.5
Ok, you need to add a field in the plugin.yml. api-version: 1.16
That should solve your issue.
Legacy Materials are used if you don't specify an api version.
💀
I'll try and let you know how it goes
Works! A thousand thanks
How to set world's time to day? What's the exact long value for start of the day in minecraft? 0?
Minecraft days start at 0 and end at 24000.
Tysm!
Hi, is there a fast way to copy a specific block with all it's data, like content for chest or text for signs etc (basically all blocks that can be altered in any way) ?
the fastest way would be to just copy the nbt data from the chunk
well correction that is the safest fastest way
the unsafe fast way would be to just look inside the region file and grab the data you are looking for without waiting on the server to load it lol
Cureently i have this that copies facing + block but not content
Material blockToPaste = bottomBlock.getBlock().getType();
BlockData blockData = bottomBlock.getBlock().getBlockData();
spawnPoint.getBlock().setType(blockToPaste);
spawnPoint.getBlock().setBlockData(blockData);
oof bruteforcing 😅
Hey, I use some NamespacedKey in my plugins. Is it a good habit to set these static final or is there another way to create them? An example is:
public static final NamespacedKey MAP_KEY = new NamespacedKey(Minesweeper.getPlugin(Minesweeper.class), "map");
[12:12:19 PM ERROR] [Minecraft] Could not pass event PlayerInteractEvent to
someone knows why?
Well you didn't provide the full error so we're kind of left guessing, but both getClickedBlock() and getItemInUse() can be null which would throw an error.
the full error was just Could not pass event PlayerInteractEvent to PluginName-1.0
oh ok
thx
?paste thats a lie
static final yes
Anyone know a way I can change peoples names on their head?
Yh probably packets
What version?
1.19.2
Can i do team with prefix and suffix
No clue
The error just says the method NametagEdit.getApi() returns null
Add scope provided to nametagedit
still giving the same error :(
do i need to remap/reobsfucate if im using something.b().b() or is that obsfucated
and not needing remapping
that is obfuscated
so i shouldnt need to do anything else?
shouldn't need to if its already obfuscated
this gets somewhat easier
I have always used obfuscated code as its never been an issue in just looking to see what it does lol
screamingsandles ftw
where can i find docs for api.spigotmc.org and is there any api for java?
?jd-s You mean that?
Spiget might have a wrapper, but not completely sure about that
There definitely aren't any docs within an official capacity that I am aware of
I should make that every time I use a tool (in this case a wooden shovel) it decreases its durability by 30, the code works except for the part where it actually has to decrease the durability. Reading on I found that setDurability and getDurability have been deprecated. How could I modify the code to make it fit and make it work?
You need to increment the damage
What do you mean, could you be more specific?
however if I had to guess your item.getType().getMaxDurability() > durability is the root cause of your issue. The APIs should still work, even if they are deprecated
Well there are caveats attached to it which is why they are deprecated. If you are unsure - better read the notice in it's entirety
declaration: package: org.bukkit.inventory.meta, interface: Damageable
oh thanks 🙂
I can't figure out how to get the value with hasdamage() and give it one with getdamage()
You use getDamage
well hasDamage() is only going to give you two values
so I mean not really whole lot of options there
you have to cast it to damageable
or better you should use an if check with instanceof
hasDamage() returns a boolean
either it is going to be true or it is going to be false
Our problems came on testing phase when we tried all posible events that may happen.
For example, redis service is shutdown, what happen with our pub/sub data? Well that data will be loosted
I don't know if i really explained My point
No no i don't think You understand what i keak
Althought there is something called RabbitMQ another mesaage broker which has a similar way for transmiting data but works using the collector based concept instead of pub/sub
im getting this error https://paste.md-5.net/tojiletihi.cs on https://paste.md-5.net/vogixirube.coffeescript this build.gradle and i cant figure out why
and that appears on gradle reload
For example
I tried like this, it still doesn't work
In case of using rabbit data is never loosted because it's queue before being sent
Depends on how the queue is handled
You will need multiple queue servers and replicate data, so nothing is lost if the queue server goes down
Ok
So there i will need to make usage of?
I don't really understand how they make data replication
RabbitMQ is not necessarily an in-memory queue. It does save to disk and IIRC u can control some of this behaviour
Okay
I thought that both of them worked directly on memory
I suppouse that rabbit save the data to disk but it's still a memory if i'm not wromg
Ultimately tho, replication and automatic recovery is the way to ensure HA
Ok, so what do u recommend me for data replication?
From My personal experience i never need to replicate the same data
The most related i have done is replication with mongo and redis using their incorporated clustering system
I need to check but I think if your queues are durable the data will be persisted in case of some kind of failure. Lemme check tho
K yh https://www.rabbitmq.com/reliability.html and https://www.rabbitmq.com/publishers.html#message-properties explains basically everything you'd need to know
Allrigth thanks gentle man
multi module is confusing
Hey, this code works when a user joins (this code is ran on join):
var board = Bukkit.getScoreboardManager().getNewScoreboard();
player.setScoreboard(board);
var obj = board.registerNewObjective(OBJECTIVE_ID, Criteria.DUMMY, Component.empty());
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
var team = board.registerNewTeam("test");
team.setPrefix("TEST PREFIX");
obj.getScore("test").setScore(0);
However, when they relog, no scoreboard is shown. Also note, creating a new scoreboard is a weak reference. So, it is destroyed when the user logs out (and no I do not store a reference to it)
Does anyone have any ideas (this is on 1.19.3, in Java 17)?
Anyone help me with this? Can't workout why it's getting stuck at the contains checks...
I would create a custom class which manage the socoreboaed itself and them a repository based object
@echo basalt for some reason gradle is saying shadowJar isnt a applicable type for my root project and its just started happening after ive added my multi-module stuff and i dont how why or how its happened and how to fix it
what makes you think I'm a gradle expert
I have beginner level of knowledge when it comes to gradle
That sound really rude
Hahaha
idk
Anyone? 🙂
you have like 600 projects
?ask
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!
any errors
what part are you getting stuck on
The checks for the arraylist
checking if the list contains the uuid?
Yep
i doubt it being final is doing any good
Does anyone have any idea why it's not working?
Yeah idk the ide highlights it as an error without
Makes sense for it to not be final though
Field 'STAFF' may be 'final'
ss it
it can be final because you aren't setting the variable anywhere but there
Yeah that is true, I'm only checking for contains etc
Still don't get why it's getting stuck
No the events just aren't working, i debugged and it gets stuck at the checking of if the player is in the arraylist, I'm debugging the adding of the player right now
it gets "stuck" sort of sounds like it halts the thread. Are you using the same reference of ModeHandler to add them as when you check it?
are you creating 1 instance of the class on the command and 1 instance on the events
Seperate classes
you're creating two instances...?
so you have 2 new ModeHandlers?
No
you are creating 2 instances of the class then
where are you getting modeHandler from?
hmm yeah I need to make it extend the class don't i, i am making 2 instances
you don't need to extend it
just make one instance
It's two classes, command and listener
either a static instance or one in your plugin class
making the instance in main class is probably easier
Yeah i'll do that thanks
so you can do static ModeHandler#instance or in your plugin class
to be honest though that looks more like a utility class
you'd be better off just making the whole class static
Never come across this before didn't realise it messed it up doing it like that
Lol yeah ima avoid static
okay so i think this will be my one and only multi module project
no it doesn't..
makes everything throw nomethodfoundexceptions
anyone have an idea on this?
Component.empty() sounds like paper to me
shhh
?whereami smh
Adventure, not paper
Learn your libraries
We need more context to it
in this case lets just say im using adventure
what do you need to see
that's basically it, I set the lines it works when I first join
I've debugged that part and I'm almost certain it's those lines right there
Just so I know i'm right why, can you explain to me rq why creating the instance in the command class and in listener class of the modehandler messed that up?
the code creates the scoreboard on join, I set the lines later on (all of this 100% happens)
you create a new instance, so create a new array that doesnt have any of the entries in
Really, I want the full scope. These lines are NOT the issue
Yhyh sound
Block block = blocks.get(i);
if (block.getRelative(BlockFace.UP).getType() == Material.AIR);
else if (block.getRelative(BlockFace.DOWN).getType() == Material.AIR)
block = block.getRelative(BlockFace.DOWN);
else continue;
i feel like there's a way to not have an empty if
but i cant think of it atm
i think i have to swap to maven
Block block = blocks.get(i);
if (block.getRelative(BlockFace.DOWN).getType() == Material.AIR && block.getRelative(BlockFace.UP).getType() == Material.AIR) {
block = block.getRelative(BlockFace.DOWN);
} else if (block.getRelative(BlockFace.UP).getType() == Material.AIR) {
continue;
}
No.
var board = Bukkit.getScoreboardManager().getNewScoreboard();
player.setScoreboard(board);
var obj = board.registerNewObjective(OBJECTIVE_ID, Criteria.DUMMY, Component.empty());
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
var team = board.registerNewTeam("test");
team.setPrefix("TEST PREFIX");
obj.getScore("test").setScore(0);
Same issue
wait i typed that wrong
I disagree. Anything over 0 is not fine
fixed it
why should i type {} for something that doesnt need it
still not the issue
?paste the whole method
because it is just pressing a single key and still helps?
then it should not work in any circumstance
You never assign the player to the objective
List<Block> blocks = player.getPlayer().getLineOfSight((Set<Material>) null, 20);
for (int i = blocks.size() - 1; i >= 0; i--) {
Block block = blocks.get(i);
if (block.getRelative(BlockFace.UP).getType() == Material.AIR);
else if (block.getRelative(BlockFace.DOWN).getType() == Material.AIR)
block = block.getRelative(BlockFace.DOWN);
else continue;
player.getPlayer().teleport(block.getLocation().add(0.5, 0, 0.5).setDirection(player.getPlayer().getLocation().getDirection()));
if (hasExecutorMessage())
player.getPlayer().sendMessage(getExecutorMessage());
return true;
}
or ... lemme see how I do it
i want to do nothing if above block is air
also you were right
I just tested that code
im stupid LMAOOOO
god such a stupid bug
Did someone hijack @wet breach 's account
public static ArrayList<String> colorArray(String string) {
String[] splittedString = string.split("@");
ArrayList<String> strings = new ArrayList<> (Arrays.asList(splittedString));
ArrayList<String> finalStrings = new ArrayList<>();
for (String str : strings) {
ChatColor.translateAlternateColorCodes('&', str);
finalStrings.add(str);
}
return finalStrings;
}
im trying to split and color a string
tis not working :/
pls help
if you want the colour to pass you need to get the last colour and apply that to the next string
Best way to loop round the edge of an inventory? I tried imagining it was a 2darray but it hasn't gone to plan...
ye i tried to use ChatColor.nextColor() (i think) but i just dunno how i would pass the color to the next string
i would say 2 for loops and then just get the side blocks
ahh kk
declaration: package: org.bukkit, enum: ChatColor
Oh no forum stuff
I am getting 600+ can't find superclass or interface when using proguard. any idea?
I searched on google but didn't get proper help.
here is the proguard config.
-dontoptimize
-dontshrink
-dontobfuscate
-keep public class * extends org.bukkit.plugin.java.JavaPlugin {
public *;
}
-keep public class * extends org.bukkit.command.Command {
public *;
}
-keep public class * extends org.bukkit.event.Listener {
public *;
}
for (int a = 0, b = 18; a <= 8 && b <= 26; a++, b++) {
do(a);
do(b);
}
``` then just do the stuff for the extra
You might need to add bukkit on the classpath
But I am not 100% sure given that I am not using proguard
@Override
public boolean onClick(AbilityPlayer player, PlayerInteractEvent event) {
if (hasExecutorMessage())
player.getPlayer().sendMessage(getExecutorMessage()); player.getPlayer().setVelocity(player.getPlayer().getEyeLocation().getDirection().setY(0).normalize().multiply(10).setY(0.5));
return true;
}
not even moving me in my eye direction
A) Is that method called?
B) Are you sure that hasExecutorMessage() returns true
it works most of the time
hasexecutor msg doesnt matter
that's just to send the message You used ravage
ye it's called
it sends me the correct way most of the time
It always works if i'm in the air
Sql Syntax error
Is there no way of doing it like a 2darray as the inventory changes dependant on config
it does
If it was a 2darray id be able to do it
If it returns false we don't need to hold this discussion
but can't do nested for loop the way you would with 2darray
if (hasExecutor()) when its false be like
<hjkl jnbkötdjnh
But of course there is an absolute idiot telling otherwise
thats me
Give the hasExecutorMessage contents
BRO IT DOESNT MATTER
IT DOES
no it doesnt
AH LOL
only the send message relies on that if
if you realise the ssyntax its great
my issue is with setvelocity
Ah, it's because I thought that in this message discord did line wrapping stupidity and did not realizer that those are two different lines
it works all the time if im in the air and use it. It works unreliably on the ground
Most likely due to something known as gravity and friction. Perhaps moving the player a tiny bit more at teh Y axis might help?
hm, i'll try
i dont understand why it's moving me in a completely different direction
As in if it only works on air just make the player be in the air
i mean high up in the air
if they're near the ground it's still unreliable
Is there a way to check if a Material exists in that particular version?
Like for example Mob Spawners were MOB_SPAWNER and then became SPAWNER but I want my plugin to work for both versions so I'm trying to do like Material.valuesOf("SPAWNER")... and then check if the material was found or not and if not get MOB_SPAWNER instead.
is there a way for this? 🤔
if i try to check if it's null it says it will always be false.
ternary operators
Try catch
wait I guess Material.getMaterial("name") will do the job
XMaterial smh
Material.valueOf("SPAWNER") == null ? true : false;
checking if its null no longer says "always false"
whats the different between getMaterial and valueOf?
Bruh that method never returns null
valueOf is never null
I assume they implemented it as the Enum method
found the issue @remote swallow
it's the way mc handles collisions with blocks internally
well mc 1.8.8
since that's what my client wants it for
i guess this works
Smh